Include GAC Assemblies in Bin

て烟熏妆下的殇ゞ 提交于 2019-12-10 12:49:52

问题


Any ideas how to force a GAC DLL into referenced?

Here is my issue, I constantly use a 3rd party DLL that registers itself into the GAC, and when I use it in my project, it reads it from the gac, and when I deploy, I'm always forgetting to add the DLLs since it is not located in the Bin/Referenced folder.

Anyway to force Visual Studio to add the DLL instead of from GAC?


回答1:


Right click on the assembly reference, select properties, and change "Copy Local" to true. That will cause it to copy the assembly into the deployment directory




回答2:


Copy Local only works if the GAC'd assembly if one reference level deep. For instance, if you have a project that references the GAC'd assembly, and that project if referenced by your web project, then while yes, the GAC'd assembly will be copied to the first project's bin folder, but it won't be copied to your web project's bin folder.

The solution, then, is to directly set a reference in the web project to the GAC'd assembly, and specify Copy Local. Even though the web project doesn't directly use the reference in this case, it will copy it to the web application's bin folder.




回答3:


Select the dll in your references and set CopyLocal=true in the properties window.




回答4:


Select the reference and set the Copy Local property to True



来源:https://stackoverflow.com/questions/2723512/include-gac-assemblies-in-bin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!