Ways to add a. NET assembly to the GAC using Gacutil.exe

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.