问题描述
我尝试部署约code到客户机,在这里我不想安装MS Windows的SDK工具。这意味着我没有获得GACUTIL。我也没有对我的code创建一个安装程序。看来,这可能是在.NET 4.0中仅有的两个选项。
I've trying to deploy some code to a client machine, where i don't want to install MS windows SDK tools. This means i don't have access to "gacutil". I also have not created an installer for my code. It seems that these might be the only two options in .net 4.0.
在过去,我只会去开始,运行,键入集结号,并将其拖放我的DLL研究。
In the past I would simply go to start, run, type "assembly", and drag and drop my dll in.
这是不再可能?当我试图做到这一点我没有得到任何错误消息,但该dll不会出现在集结号文件夹中。当我使用GACUTIL我开发机的正常工作,但该dll仍然没有出现。
Is this no longer possible? When i try to do this i get no error message, but the dll doesn't appear in the "assembly" folder. When i use gacutil on my dev machine it works properly, but the dll still doesn't appear.
推荐答案
在.NET 4.0中移除微软只需拖放添加的DLL大会的能力。
In .net 4.0 Microsoft removed the ability to add DLLs to the Assembly simply by dragging and dropping.
相反,你需要使用的Gacutil.exe,或创建一个安装程序来做到这一点。实际上微软不建议使用GACUTIL,但我去了这条道路呢。
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.
要在开发机器上使用GACUTIL去:开始 - >项目 - >微软的Visual Studio 2010 - > Visual Studio工具 - > Visual Studio命令提示符(2010)
To use gacutil on a development machine go to:Start -> programs -> Microsoft Visual studio 2010 -> Visual Studio Tools -> Visual Studio Command Prompt (2010)
然后使用这些命令卸载并重新安装分别。注意我并没有包括 .DLL
在卸载命令。 GACUTIL / U MYDLL
GACUTIL / IC:\ Program Files文件\自定义\ MYDLL.DLL
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 Files\Custom\myDLL.dll"
要非开发计算机上使用GACUTIL,你必须从你的dev的机器复制的可执行文件和配置文件的生产机器。它看起来像有几个不同的版本GACUTIL的。这为我工作的一个,我发现在这里: C:\ Program Files文件(x86)的\微软的SDK \的Windows \ v7.0A \ BIN \ NETFX 4.0工具\的Gacutil.exe
C:\ Program Files文件(x86)的\微软的SDK \的Windows \ v7.0A \ BIN \ NETFX 4.0工具\ gacutil.exe.config
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 SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe.config
在这里或到相应的.NET文件夹中复制文件; C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319
Copy the files here or to the appropriate .net folder;C:\Windows\Microsoft.NET\Framework\v4.0.30319
然后使用这些命令卸载并重新安装分别C:\用户\ BHJeremy \桌面\在.NET 4.0中\的Gacutil.exe安装到GAC/ UMYDLL
Then use these commands to uninstall and reinstall respectively"C:\Users\BHJeremy\Desktop\Installing to the Gac in .net 4.0\gacutil.exe" /u "myDLL"
C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \的Gacutil.exe/ IC:\ Program Files文件\自定义\ MYDLL.DLL
这篇关于拖放一个DLL的GAC("装配")在Windows Server 2008的.NET 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!