Subscribe

RSS Feed (xml)

Manage the Global Assembly Cache in Csharp

Before you can install an assembly in the GAC, the assembly must have a strong name. To install an assembly named SomeAssembly.dll into the GAC, use the command gacutil /i SomeAssembly.dll.

To uninstall the SomeAssembly.dll assembly from the GAC, use the command gacutil /u SomeAssembly. Notice that you don't use the .dll extension to refer to the assembly once it's installed in the GAC.

To view the assemblies installed in the GAC, use the command gacutil /l. This will produce a long list of all the assemblies installed in the GAC, as well as a listing of assemblies that have been precompiled to binary form and installed in the ngen cache. To avoid searching through this list to determine if a particular assembly is installed in the GAC, use the command gacutil /l SomeAssembly.

Note

The .NET Framework uses the GAC only at run time; the C# compiler won't look in the GAC to resolve any external references that your assembly references. During development, the C# compiler must be able to access a local copy of any referenced shared assemblies. You can either copy the shared assembly to the same directory as your source code or use the /lib switch of the C# compiler to specify the directory where the compiler can find the required assemblies.

No comments:

Post a Comment

Archives

LocalsAdda.com-Variety In Web World

Fun Mail - Fun in the Mail