Visual Studio and add-in unloading

你离开我真会死。 提交于 2019-12-11 01:07:44

问题


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?


回答1:


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 :(



来源:https://stackoverflow.com/questions/346674/visual-studio-and-add-in-unloading

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