Question

I have Add-in that run successfully in Visual Studio 2010, but when I run it in Visual Studio 2012 the DebuggerEvents.OnEnterRunMode Event doesn't fire. In the MSDN there is nothing about changes in DebuggerEvents events between Visual Studio 2010 and Visual Studio 2012.

My code is:

static DebuggerEvents dbgEvents;

    public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
    {
     _applicationObject = (DTE2)application;
     _addInInstance = (AddIn)addInInst;

     dbgEvents = _applicationObject.Events.DebuggerEvents;

     ...

     if (registered)
       {
       return;
       }

    dbgEvents.OnEnterRunMode += new _dispDebuggerEvents_OnEnterRunModeEventHandler(DebuggerEvents_OnEnterRunMode);
    dbgEvents.OnEnterDesignMode += new _dispDebuggerEvents_OnEnterDesignModeEventHandler(dbgEvents_OnEnterDesignMode);
    registered = true;
   }
    void DebuggerEvents_OnEnterRunMode(dbgEventReason Reason)
     {
      ...
     }

OnConnection() and other events like SolutionEvents.Opened are fired, but when I click on 'start' to run project in visual studio, the event OnEnterRunMode doesn't called. any ideas?

Was it helpful?

Solution

I found the solution:

The DebuggerEvents.OnEnterRunMode() event use EnvDTE.dll.

When the property of the EnvDTE.dll Embed Interop Types is True, the DebuggerEvents.OnEnterRunMode event doesn't fire.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top