解除 VisualStudio 对 addin dll 的写锁定
我试图找到解决 VisualStudio 2010 的插件概念的方法,但在编译解决方案时不断遇到相同的错误:
“无法删除文件 '.\bin\VSA.dll'。访问路径 [...] 被拒绝”
我怀疑当我尝试在 Visual Studio 的“开发实例”中加载插件时会发生这种情况编译解决方案,但插件似乎在“插件管理器”中正确勾选,并且 .Addin 文件包含
这应该是正确的。
知道什么可能导致锁定或如何追踪是什么原因?谢谢!
I am trying to find my way around the addin concept of VisualStudio 2010 but I keep on getting the same error when I compile the solution:
"unable to delete file '.\bin\VSA.dll'. Access to the path [...] is denied"
I suspected this would happen when the addin is loaded in the "dev instance" of Visual Studio while I try to compile the solution, but the addin seems to be correctly ticked out in the "Add-In Manager" and the .Addin file contains <LoadBehavior>0</LoadBehavior>
which should be right.
Any idea what could be causing the lock or how to track down what is? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您必须重新启动 VS 才能卸载插件,勾选该复选框不会从 devenv.exe 卸载程序集。
对我来说似乎有用的是勾选插件并启动 2 个 VS 实例,其中一个打开添加项目,另一个用于调试插件。
然后在第二个实例中启用插件以触发插件的初始化并对其进行调试。
在VS的第二个实例中禁用插件,关闭VS。
重新编译第一个实例中的插件项目,再次启动第二个实例。
You have to restart VS for the addin to get unloaded, ticking out the checkbox won't unload the assembly from devenv.exe.
What seems to be working for me is to have the addin ticked out and start 2 instances of VS one with the adding project opened and one to debug the addin in.
Then enable the addin in the second instance to trigger the addin's initialization and debug it.
Disable the addin in the second instance of VS, close the VS.
Recompile the addin project in the first instance, start a second instance again.
另一种简单的方法是勾选该复选框,关闭 Visual Studio,删除输出文件,最后重新启动 Visual Studio。
Another simple way is to tick off the checkbox, close Visual Studio, delete the output files and finally restart Visual Studio.
Unlocker 是一个有用的程序,当您因 dll 被锁定而无法构建时可以使用它。
Unlocker is a useful program for when you're unable to build because your dlls are locked.