I am developing an Extension (VSPackage), I am subscribing to 2 of the Debugger events in the constructor of VSPackage.cs
public sealed class ComboBoxPackage : Package
{
....
public ComboBoxPackage()
{
Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));
_dte = (DTE)Package.GetGlobalService(typeof(DTE));
_events = _dte.Events;
_debuggerEvents = _events.DebuggerEvents;
_debuggerEvents.OnEnterRunMode += _debugEvents_OnEnterRunMode;
_debuggerEvents.OnContextChanged +=_debuggerEvents_OnContextChanged;
}
void _debuggerEvents_OnContextChanged(EnvDTE.Process NewProcess, Program NewProgram, Thread NewThread, EnvDTE.StackFrame NewStackFrame)
{
throw new NotImplementedException();
}
private void _debugEvents_OnEnterRunMode(dbgEventReason Reason)
{
return;
}
}
when I'm running it ( strating run an application ) only _debuggerEvents_OnContextChanged is called, and _debugEvents_OnEnterRunMode is not called.
if I did the same with Addin project all works fine.