GAC - To add an assembly to the GAC, drag and drop works, but copy and paste doesn't? Why?

情到浓时终转凉″ 提交于 2019-12-20 10:48:27

问题


I would like to know why drag and drop works, and copy paste doesn't. What is happening with a drag and drop that isn't happening with a copy and paste?


回答1:


When you drag and drop your assembly into C:\windows\assembly folder, it doesn't really get copied there—a special Windows Explorer plugin callis gacutil to install your assembly into GAC.

This Explorer plugin can be confusing because it may give one an illusion that GAC is just plain simple folder with lots of DLLs. Actually, it is a hierarchical structure with a folder for each assembly name, inside of which there are folders for different versions, and so on.

If you want to see the real GAC structure, open HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion in Windows Registry and set DWORD DisableCacheViewer to 1. This will disable Cache Viewer plugin that makes GAC look so simple (but it also will make drag and drop to install unusable—you'll have to call gacutil yourself). Of course, you can use alternative file managers or console as well, if you don't want to mess with registry settings.

As for the reasons why copy-pasting does not work, I believe whoever designed Cache Viewer plugin thought that drag and drop is a good metaphor for putting something in GAC, whereas implementing copying and pasting would really make GAC seem like a normal folder—which it is not.




回答2:


Thanks Dan Abramov: i added some thing more on that

Problem :Copy and paste is not working under assembly for install a new dll (C:\windows\assembly folder)

Ans:- you can see the folder architecture via changes the regedit entry through string "DisableCacheViewer" DWORD under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion make as it "1"

so you can see the folder view under the same .

and you can Dump all other assembly Dll through utility Open a CMD and type below to use the Utility for install "gacutil /i .dll"

for UN-install "gacutil /u .dll"

if you need to install/ Uninstall more than one assembly so you can use

/il

and

/ul

option

best is that you can make a batch file and run under "C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin" at once only

Thank you Ashutosh Soni



来源:https://stackoverflow.com/questions/5110345/gac-to-add-an-assembly-to-the-gac-drag-and-drop-works-but-copy-and-paste-doe

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