1

I am using WinForms, Visual Studio 2013, .Net 4.5

When running my application through the Visual Studio Profiler, it works exactly the way it should and when running it through either Debug or Release mode, I face horrible freezing and repainting issues.

What is the difference between running your application in the Visual Studio Profiler vs. running in through the Release Mode?

Thank you in advance

TH Todorov
  • 1,129
  • 11
  • 26
  • 1
    Can you narrow it further? Perhaps by splitting that "several hundred lines" into multiple methods? – Jim Mischel Sep 25 '14 at 19:33
  • Please see http://stackoverflow.com/help/mcve for assistance in formulating your question to attract good answers and assistance – jordanhill123 Sep 25 '14 at 19:34
  • What is the difference between running your application in the Visual Studio Profiler vs. running in through the Release Mode? It is quite simple, if you don't know the answer, no need to vote down the questions, even if it doesn't help me, it might help oithers – TH Todorov Sep 25 '14 at 19:36

1 Answers1

4

Finally found the answer here: Why does my program run way faster when I enable profiling?

When you run your application within Visual Studio, the debugger is attached to it. When you run it using the profiler, the debugger is not attached.

If you press F5 to run your program, even with the Release build, the debugger is still attached.

Since I was running my application through Visual Studio, I was seeing some really strange behavior such as slow repainting, freezing, etc. - I spent days chasing the usual suspects, double buffering, not invoking calls from background threads, missing locks, etc. and it turns out I was chasing a bug that wasn't there on a first place. Hope this saves someone hours or headache.

Community
  • 1
  • 1
TH Todorov
  • 1,129
  • 11
  • 26