KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm developing a language service for Visual Studio through a VSPackage. I need to update my parse data whenever files get added/removed from the solution's projects. I want to subscribe to solution and project events. I tried as follows, but none of these events get fired when I add/remove projects to the solution or add/remove items to projects. DTE dte = (DTE)languageService.GetService(typeof(DTE)); if (dte == null) return; ((Events2)dte.Events).SolutionEvents.ProjectAdded += SolutionEvents_ProjectAdded; ((Events2)dte.Events).SolutionEvents.ProjectRemoved += SolutionEvents_ProjectRemoved; ((Events2)dte.Events).ProjectItemsEvents.ItemAdded += ProjectItemsEvents_ItemAdded; ((Events2)dte.Events).ProjectItemsEvents.ItemRemoved += ProjectItemsEvents_ItemRemoved; What's the best way to subscribe to these events from a VSPackage?
Tags (comma-separated)
Save Edits
Cancel