Here is a simple test application (in F#, but I checked and the same problem occurs in C#):
let but = new Button(Content = "click me")
but.Click.Add(fun e -> printfn "clicked")
[<STAThread>]
do (new Application()).Run(new Window(Content = but))
When running this in VS 11 preview (no matter which .NET version), the "clicked" message appears ~0.5 seconds after clicking. The same happens in C#. When I go to the folder where the project is stored and run the .exe outside of VS then the message appears instantly after clicking. Apparently the debugging instrumentation is slowing this particular case down tremendously. Why is this and what can be done about it?
I cant say for sure, but my past experience with developer previews is that they have monitoring and tracing code that is running and submitting feedback to microsoft. This has caused slowdowns for me before in other previews (cant remember if button clicks were affected). You might submit feedback to microsoft though to ensure they know about it.
Or... I don't have VS v.11, but similar bug happeneds in VS 2010.
Go to: Debug->Options and Settings->Debug->General, select: "Break when exceptions cross AppDomain...".
If debugger stops now on these exceptions, it means, that the old bug is not fixed. It's Visual Studio bug, so everything works fine when running .exe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With