Install with Gacutil.exe tool:gacutil-i "full path of DLL file to register"
The "Gacutil.exe" tool is. NET comes with tools, it is important to note that this tool is not included in the. NET Framework runtime. He is part of the SDK. For example, in the. NET Framework 2.0, we will have to download the. NET Framework 2.0 SDK separately, or if Visual Studio is installed, to have this tool.
Enter "cmd" into the command window at the start of the run, select the directory where the "Gacutil.exe" file is located by CD,
or use the Visual Studio command prompt
As in the command line input: gacutil-i D:/microsoft.sharepoint.dll
You can enter ' gacutil-? ' View Help
Note: However, you cannot install a weak named assembly into the GAC. Before we proceed with the installation of the above 2-3 methods, we must ensure that the project has a strong name.
Adding a name to a project requires the following three steps:
1. After the project has been debugged, use the Sn.exe tool to generate a key. Sn-k "The full path of the generated key".
As in the command line input: Sn-k d:/mykey.snk
2. Associate the key with the project's assembly: Project Properties--sign----------Select the strong name key file for the assembly.
In addition, there is another way to modify the properties of the "AssemblyKeyFile" in the project's AssemblyInfo.cs file.
such as: [Assembly:assemblykeyfile ("D://mykey.snk")]
3. Rebuild the project set.
Ways to add a. NET assembly to the GAC using Gacutil.exe