In .net 4.0 Microsoft removed the ability to add DLLs to the Assembly simply by dragging and dropping.
Instead you need to use gacutil.exe, or create an installer to do it. Microsoft actually doesn’t recommend using gacutil, but I went that route anyway.
To use gacutil on a development machine go to:
Start -> programs -> Microsoft Visual studio 2010 -> Visual Studio Tools -> Visual Studio Command Prompt (2010)
Then use these commands to uninstall and Reinstall respectively. Note I did NOT include .dll
in the uninstall command.
gacutil /u myDLL
gacutil /i "C:Program FilesCustommyDLL.dll"
To use Gacutil on a non-development machine you will have to copy the executable and config file from your dev machine to the production machine. It looks like there are a few different versions of Gacutil. The one that worked for me, I found here:
C:Program Files (x86)Microsoft SDKsWindowsv7.0ABinNETFX 4.0 Toolsgacutil.exe
C:Program Files (x86)Microsoft SDKsWindowsv7.0ABinNETFX 4.0 Toolsgacutil.exe.config
Copy the files here or to the appropriate .net folder;
C:WindowsMicrosoft.NETFrameworkv4.0.30319
Then use these commands to uninstall and reinstall respectively
"C:UsersBHJeremyDesktopInstalling to the Gac in .net 4.0gacutil.exe" /u "myDLL"
"C:WindowsMicrosoft.NETFrameworkv4.0.30319gacutil.exe" /i "C:Program FilesCustommyDLL.dll"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…