Search code examples
c#wpfperformancebuttonclickintellitrace

WPF Application stalls/freezes after first interaction, like button click


I'm currently experiencing a problem in WPF. The UI loads fine, but whenever the first user interaction is made, such as a button click, the application seems to stall, or example if I had two buttons that display a MessageBox, the first click will wait for a few seconds then show the MessageBox, but any subsequent interaction is instantaneous and responsive.

Has anyone else experienced this? And if so, is there any solution?

Thanks


Solution

  • I had the same problem. Every time I called the first interaction from a Button or ICommand the UI would freeze for like half a second.

    I tracked down the issue with the hint of the author to start application directly from the folder. This solved the issue, but I also wanted to know why this happens and thought about what the difference is between direct execution and debugging.

    So I figured out that IntelliTrace caused the freeze, which was still enabled since I activated it once for debugging an ADO.NET application. After disabling, the UI Freeze is gone. To disable it go to Debug -> IntelliTrace -> Open IntelliTrace Settings -> untick "Enable IntelliTrace".