Restart a VSpackage, like if it was just loaded
i would like to now how can i restart a VSpackage, i mean like if it was loaded from zero. Ive created a extension that works with the actual solution and when i need to change to other solutio开发者_开发百科n the state of the extension remains, and i don't want that. Till now i close the IDE and then launch it again with the extension in his primal state. Having the possibility to reset without closing the IDE would be a lot better.
Once Visual Studio loads your VSPackage binary, it will remain loaded in memory until the process is ended. This is simply part of the architecture of Visual Studio.
You should change your extension to handle the fact that Visual Studio users will have multiple solutions opened over time during a single session.
You can achieve this by designing your objects such that they're associated with a particular solution.
You can subscribe to solution events in a Visual Studio package via the IVsSolutionEvents interface. When you get a notification that the solution has closed, destroy your objects that are associated with that solution.
精彩评论