简体   繁体   English

Visual Studio和加载项卸载

[英]Visual Studio and add-in unloading

When I remove an add-in from Visual Studio's add-in menu, it doesn't get unloaded from memory. 当我从Visual Studio的外接程序菜单中删除外接程序时,它不会从内存中卸载。 Does anyone know if I can write some code for my add-in (in C#) that would force this unloading. 有谁知道我是否可以为我的加载项(在C#中)编写一些代码来强制卸载。 Is this even possible, or do I have to restart VS? 这是否有可能,还是我必须重新启动VS?

If your DLL is written in managed code there is no way to force it to be unloaded as a Visual Studio Add-In. 如果您的DLL是用托管代码编写的,则无法强制将其作为Visual Studio加载项卸载。 The CLR does not support such a mechanism. CLR不支持这种机制。

The only way to force a DLL to be unloaded from a process is to tear down all AppDomains which have loaded the DLL. 强制从进程中卸载DLL的唯一方法是拆除所有已加载DLL的AppDomain。 In a Visual Studio Add-In scenario, the add-in will be loaded into the default AppDomain. 在Visual Studio加载项方案中,加载项将被加载到默认的AppDomain中。 Tearing this down necessitates tearing down the entire process :( 撕下这个需要拆除整个过程:(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM