Good afternoon,
In my project (not a visual studio addin!), I'm starting Visual Studio 2015 as follows:
Type type = Type.GetTypeFromProgID("VisualStudio.DTE.14.0");
dte = (EnvDTE80.DTE2)Activator.CreateInstance(type);
dte.MainWindow.Visible = true;
dte.Solution.Open(UserPreferences.Instance.ProjectSlnFilePath);
Now, I've noticed that when I close the IDE, a visual studio background process starts running for some reason. I'm looking for a way to detect when the IDE is being manually closed, in order to kill that background process. I tried to do the following, based on this thread:
dte.Events.DTEEvents.OnBeginShutdown += DTEEvents_OnBeginShutdown;
But it's not triggered. I've tried other events, such as Window_Closing and so on, but nothing seems to work.
Any ideas? Thanks!