简体   繁体   中英

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. Does anyone know if I can write some code for my add-in (in C#) that would force this unloading. Is this even possible, or do I have to restart 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. The CLR does not support such a mechanism.

The only way to force a DLL to be unloaded from a process is to tear down all AppDomains which have loaded the DLL. In a Visual Studio Add-In scenario, the add-in will be loaded into the default AppDomain. Tearing this down necessitates tearing down the entire process :(

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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