I’m busy with a small, simple add-in, but the process seems massively complicated and badly documented. Right now, the only event that fires in the add-in is OnConnection. The other two I’m trying to handle just don’t seem to exist.
private DTE2 applicationObject; private SolutionEvents solutionEvents; public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) { applicationObject = (DTE2)application; solutionEvents = ((Events2)applicationObject.Events).SolutionEvents; solutionEvents.Opened +=new _dispSolutionEvents_OpenedEventHandler(SolutionEvents_Opened); } private void SolutionEvents_Opened() { Debug.WriteLine('Solution loaded: ' + applicationObject.Solution.FullName); }
Umm, have you tried saving a copy of
Events.SolutionEventslocally? I’m guessing that it could ‘disappear’ if there’s no explicit reference to it in your add-in.This is just a guess though 🙂