.net 什么是缓存 AppData\Local\assembly\dl3?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8309411/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
what is cache AppData\Local\assembly\dl3?
提问by Marius Bancila
I have this assembly that for some reason Windows started to load from this path:
我有这个程序集,出于某种原因,Windows 开始从此路径加载:
C:\Users\marius\AppData\Local\assembly\dl3\MP6PT6BV.2Z4\GMRQEZL9.LCBd762c5cf066ff_7eaecc01\X.DLL
That means whatever changes I do to the assembly, the new copy of it isn't loaded from its output folder but from that cached folder. I tried deleting the folder, even restarting Windows, it is generated again and the assembly loaded from there.
这意味着我对程序集所做的任何更改,它的新副本都不是从其输出文件夹加载的,而是从该缓存文件夹加载的。我尝试删除该文件夹,甚至重新启动 Windows,它再次生成并从那里加载程序集。
So, how can I get rid of it? What do I have to do to tell the system to load the DLL from its output folder and not from the cache?
那么,我怎样才能摆脱它呢?我该怎么做才能告诉系统从其输出文件夹而不是从缓存加载 DLL?
回答by Marius Bancila
I found the answer to my question. That is the "shadow copy" folder for the .NET framework as specified in Windows Registry under HKCU\Software\Microsoft\Fusion\DownloadCacheLocation. Shadow copying is a feature in the .NET framework to allow assemblies used in an app domain to be updated without unloading the app domain. More about this feature in MSDN http://msdn.microsoft.com/en-us/library/ms404279.aspx.
我找到了我的问题的答案。这是 Windows 注册表中 HKCU\Software\Microsoft\Fusion\DownloadCacheLocation 下指定的 .NET 框架的“影子副本”文件夹。卷影复制是 .NET 框架中的一项功能,允许在不卸载应用程序域的情况下更新应用程序域中使用的程序集。MSDN http://msdn.microsoft.com/en-us/library/ms404279.aspx 中有关此功能的更多信息。
The app domain where I was loading the assembly was configured to shadow copy files, by setting the ShadowCopyFilesproperty to true.
通过将ShadowCopyFiles属性设置为true.

