I used the "Add-In for Visual Studio" wizard to create a new Addin project and now, I'm trying to add some event handlers:
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
_applicationObject.Events.BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin;
_applicationObject.Events.BuildEvents.OnBuildDone += BuildEvents_OnBuildDone;
_applicationObject.Events.SelectionEvents.OnChange += SelectionEvents_OnChange;
_applicationObject.Events.DocumentEvents.DocumentOpened += DocumentEvents_DocumentOpened;
_applicationObject.Events.DocumentEvents.DocumentSaved += DocumentEvents_DocumentSaved;
}
But whatever I do, my handlers are never executed!
Am I blind? Do I have to do anything else to register these handlers or why doesn't it work?