Cannot install assembly to cache?

时光怂恿深爱的人放手 提交于 2019-12-22 05:02:14

问题


I am trying to add an assembly to the cache on Visual Studio 2010 Command Prompt. I get this error "Failure adding assembly to the cache: Attempt to install an assembly without a strong name". I am adding a ListTasks2.dll assembly from a WCF Service App called ListTasks2. I never had this issue with a similarly-named project, so why is it raising an issue now?

NOTE: I tried signing it in Visual Studio and it still doesn't work. I wonder if it might be a permission issue. I used different user credentials and was able to add an assembly. The catch is that I loaded a VS Solution, and that project signed the assembly. Should I just create a key pair?


回答1:


Only strong-named assemblies can be installed into the GAC. For information about how to create a strong-named assembly, see How to: Sign an Assembly with a Strong Name.




回答2:


This issue seems to be thought a lot harder and more roundabout than what it needs to be.

I found a really achieveable solution here:

http://codeingaddiction.blogspot.com/2011/06/how-to-add-strong-name-to-existing-dll_16.html

For me to get this to work easily I changed directory to C:\temp - this worked a lot better to me than running directly in the folder mentioned, probably because of file permissions being more accessible in somewhere like that.




回答3:


u can create the SNK or PFX to the class libaray and then add to gacutil through VS command Prompt



来源:https://stackoverflow.com/questions/25493306/cannot-install-assembly-to-cache

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