I'm writing a VS Package where I need to store the time when the user start my package, and when the user close the Visual Studio.
The problem is, I don't know how to get the closing event for the Visual Studio. Can anyone give me any information about how to detect if the VS is closing?
Note: When I search from the internet, I got the following similar problem to mine: How do you cancel a ToolWindowPane or Visual Studio IDE close operation via a VSPackage?, but when I try it, this solution is to detect and do something when the Package window is closed, and cannot detecting when the Visual Studio is closed.
Any help is really appreciated.
Thanks
Just to make it explicit and close this problem. This is the snapshot of code to check if VS is closing:
Then in Initialize add this:
Two other methods that you need:
And