In projects, we often introduce third-party DLL files. Generally, we can copy the required DLL files to a place on the hard disk and add references to the project. This operation is very simple! But sometimes we will encounter such a situation, that is, the DLL to be referenced is in the GAC of the target machine, then we cannot manually copy it out.
In fact, Windows GAC has a corresponding directory, which is generallyC: \ windows \ Assembly \This directory contains some special class library DLL installed and registered on the local machine, users are not allowed to directly perform operations on the elements (such as copying, cutting, pasting, and modifying names ), however, you can directly drag the DLL file in another location to this directory for DLL installation, but we cannot directly copy the installed DLL. Here I will introduce a method to complete this operation.
First, switch to the command line mode of windows, that is, start-run-cmd-press enter, and then go to the directory where GAC is located. Use the Dir command to view the content, as shown in.
It seems that you can understand the directory structure in GAC. Basically, we can distinguish the Dir type based on the processor architecture column in the GAC directory, for example, the system we are looking. web. extensions belongs to msil. In cmd mode, it should correspond to gac_msil, switch to this directory, and Dir.
The system. Web. ExtensionsProgramSet, it is also a dir, continue to switch in and Dir.
At this time, there is only one directory, continue to switch in, And then dir will be able to see the DLL file we finally want, and then copy it through the Copy command and it will be OK!
tips : if the file name or directory name to be entered is too long when you use commands in cmd mode, you can press a part of the characters first, and then use the tab key to automatically complete. The windows command tool will automatically find the matching content for you!