Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 627
Gary Connell Avatar asked Oct 14 '12 19:10

Gary Connell


2 Answers

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".

like image 184
JanW Avatar answered Nov 01 '22 22:11

JanW


Thanks for reporting this performance issue. We have looked into it and tracked it down. We are looking into fixing this in a future release. Below are steps to work around this issue. Once the work around is applied there is no need to disable ‘Gesture’ events or IntelliTrace.

  1. Open up a cmd window under Admin account
  2. cd /d "%programfiles(x86)%\Microsoft Visual Studio 12.0\Common7\IDE\Remote Debugger\x64"
  3. %windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe install /NoDependencies /ExeConfig:.\msvsmon.exe Microsoft.VisualStudio.vil.host.dll

If you are using a VM you might want to first save a snapshot before applying the work around. Let us know if you run into any other issues. Thanks.

Azeem Khan

like image 3
Azeem Khan Avatar answered Nov 01 '22 23:11

Azeem Khan