GAC |
Programming assembly for GAC
This topic contains the following sections:
Assembly must be strong name to install GAC. Also the linking other assemblies requires it.
Go to Project, Properties, register Signing
Checked "Sign the assembly"
Selection in drop-down list "Choose a strong name key file" (new or browse a SNK file)
GAC folder is
%windir%\Microsoft.NET\assembly\
Go to Project, Properties, register Build Events
"Post-build event command line:"
"C:\Program Files\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil" /if "$(TargetPath)"
Important: tool GACUtil run must as administrator
Installs an assembly into the global assembly cache. If an assembly with the same name already exists in the global assembly cache, the tool overwrites it. Specifying this option is equivalent to specifying the /i and /f options together.
Starting with the .NET Framework 4, the default location for the Global Assembly Cache is
%windir%\Microsoft.NET\assembly.
In earlier versions of the .NET Framework, the default location is
%windir%\assembly.
Go to Project, References
Content menu, "Add Reference..."
Dialog "Reference Manager", choose DLL from GAC or a Project
Important: Reference property value "Copy Local" must be False