简体   繁体   English

如何将dll安装到GAC中。

[英]How to install dll into GAC.

I have to install the DLL to GAC. 我必须将DLL安装到GAC。 I have checked that same DLL is present there in the GAC related to my project. 我检查了与我的项目相关的GAC中是否存在相同的DLL。 Is my steps correct? 我的步骤正确吗?

1: Uninstall the previous DLL by clicking on File > Uninstall Assembly 1:通过单击文件>卸载程序集卸载以前的DLL
2: Open Visual Studio command prompt 2:打开Visual Studio命令提示符
3: Type this C:\\Windows\\Microsoft.NET\\Framework\\v1.1.4322> gacutil.exe \\i C:\\xyz\\My project\\Projectxyz.dll 3:键入此C:\\Windows\\Microsoft.NET\\Framework\\v1.1.4322> gacutil.exe \\i C:\\xyz\\My project\\Projectxyz.dll

OR 要么

Drag and drop the DLL from Bin to GAC ? 将DLL从Bin拖放到GAC?

Is it mandatory to give the strong name to the assembly or can I avoid it? 给装配体起好名字是强制性的还是可以避免呢? What is the side effect if I don't give the strong name? 如果我不给出强名,会有什么副作用?

To answer your last question, yes , you must strong-name your assembly in order to install it into the GAC. 要回答最后一个问题, ,您必须对程序集进行强命名才能将其安装到GAC中。

Something tells me that you don't really need to add your assembly to the GAC. 某件事告诉我,您实际上不需要将程序集添加到GAC。 Only in very few cases is there a benefit to doing this. 仅在极少数情况下,这样做会有所帮助。 Unless you know what these cases are, and know they apply to you, I'd suggest you forget about it. 除非您知道这些情况是什么,并且知道它们适用于您,否则我建议您不要理会。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM