GACUtil “Assembly successfully added to the cache” but “Number of items = 0”

﹥>﹥吖頭↗ 提交于 2020-01-13 07:54:05

问题


Why, when I run:

gacutil –i  myAssembly.dll

do I get:

Assembly successfully added to the cache

But then when I run:

gacutil –l  myAssembly.dll

I get

Number of items = 0

?


回答1:


try with

gacutil –l  myAssembly

donot add .dll at last.So if the dll is registered in GAC it will display

Number of items = 1

http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx




回答2:


Silly reason, really, but it took me what felt like hours to fix and is not really something you want to have to deal with when you’re in the middle of trying to figure out a complex problem.

To add the assembly to the GAC you need to specify the .dll extension, but when trying to query it or unregister it you must NOT specify the .dll extension.

Running

gacutil –l  myAssembly

will return

Number of items = 1


来源:https://stackoverflow.com/questions/3393981/gacutil-assembly-successfully-added-to-the-cache-but-number-of-items-0

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