重新启动 VSpackage,就像刚刚加载一样
我现在想知道如何重新启动 VSpackage,我的意思是如果它是从零加载的。我创建了一个适用于实际解决方案的扩展,当我需要更改为其他解决方案时,扩展的状态仍然存在,但我不希望这样。到目前为止,我关闭了 IDE,然后再次启动它,扩展处于原始状态。如果能够在不关闭 IDE 的情况下进行重置,那就更好了。
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 solution 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一旦 Visual Studio 加载 VSPackage 二进制文件,它将保持加载在内存中,直到进程结束。这只是 Visual Studio 架构的一部分。
您应该更改您的扩展,以处理 Visual Studio 用户在单个会话期间随着时间的推移打开多个解决方案的事实。
您可以通过设计对象使它们与特定的解决方案相关联来实现此目的。
您可以通过 IVsSolutionEvents 接口。当您收到解决方案已关闭的通知时,请销毁与该解决方案关联的对象。
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.