Some of the initialization code in our package is called from OnShellPropertyChange handler (from IVsShellPropertyEvents interface).
This initialization code is called on a condition:
// when zombie state changes to false, finish package initialization if ((int)__VSSPROPID.VSSPROPID_Zombie == propid) { if ((bool)var == false) { ...i.e. we proceed with initialization, when IDE is out of the 'zombie' state.
Now, a part of the initialization is retrieving the events object for Project Items Events via Events.GetObject("VCProjectEngineEventsObject").
The issue is that on a Visual Studio 2013 Community Edition, when its' license expires (with a message 'The license has expired'), the GetObject method throws a 'System.Exception' exception. So this exception is thrown, and only after that the 'license expired' dialog is shown by the IDE.
What would be a correct way to handle such a situation, i.e. which interface\handler should we use to check whether the license is valid?
Thanks!