Add DLL to GAC (Global Assembly Cache)

Source: Internet
Author: User

How can I load a DLL to GAC? Oracle was a problem. dataaccess. DLL problem. 10 Gb is installed on the sub-host, but later we know the oracle. dataaccess. dll contains a new method oraclebulkcopy, similar. net is used for SQL Server sqlbulkcopy. At that time, I wanted to use the DLL directly, but I wrote an example.ProgramAn error occurs during running, that is, the DLL must be registered in GAC. That is depressing. It may be because I was too dull. Later I thought of an error that may be caused by the inconsistency between the Oracle. dataaccess. dll version in GAC and the reference in the program.

In fact, a tool provided by. Net can register the DLL to GAC. It has never been noticed before. Gacutil.exe. Start Menu-Microsoft Visual Studio-Visual Studio Tools-Visual Studio 2008 command prompt, enter gacutil.exe in the console and press enter, you can see some parameters.

To install the DLL to GAC, select the-I parameter, followed by the complete path of the DLL file.

For example:

Gacutil.exe-I E: \ ODP. Net \ bin \ 2. x \ oracle. dataaccess. dll

In this case, the DLL is registered in the GAC. The bad thing is that the path cannot be changed. A better alternative is to copy the DLL directlyC: \ windows \ assemblyUnder this directory, register again.

If you want to know some information about a DLL registered to GAC, such as version, culture, and publickeytoken, you can also use gacutil.exe-L to view the information. For more information, see the figure above.

Hey, you can register the DLL in the GAC. It saves a lot of trouble.

I hope it will be useful to you. If it is useless, I should forget it myself,

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.