Search code examples
c#visual-studiovisual-studio-debuggingintellitrace

IntelliTrace Historical Debugging does not jump in Click-EventHandler


I have created a small WPF-Application with one Button and a Label. The Click-Eventhandler of the Button do

private void Button_Click(object sender, RoutedEventArgs e) {
    var s = this.Height;
    this.lbl.Content = s;
} 

I have activated IntelliTrace Event collecting. When I run debug and click on the Button, I see in the IntelliTrace-Event-List the corresponding events: enter image description here

When I click on "Activate Historical Debugging" Visual Studio shows the following: enter image description here

and this StackTrace: enter image description here

Why can I not jump to the EventHandler Button_Click() now?


Solution

  • (1) Please enable the Microsoft symbol servers under TOOLS->Options->Debugging->Symbols.

    (2) Check "Enable .NET Framework source stepping" and "Enable source serve support" under TOOLS->Options->Debugging.

    enter image description here

    (3) Under your project properties->Debug, disable the option "Enable the Visual Studio hosting process", and enable the option "Enable native code debugging".

    And then debug your app with breakpoint, view the result. enter image description here

    Update:

    The button click event in the intellitrace log is not what you thinks it is. It’s not tracing your code, it’s tracing the presentation framework. Intellitrace knows nothing about the event handler.

    However, you can achieve what you wants by using a tracepoint in your event handler.