2

I'm still kind of new to C#, but I like it...The problem I'm having involves the debugger. I recently started a new C# solution and copied and pasted a lot of code from a previous C# solution.

In this new solution, when an error is encountered, the program just hangs up and C# doesn't break back to debug mode where I can see the problem line, and, of course, the error. The only way out is to go back to Windows Start begin to Restart, and then cancel the Restart.

The issue doesn't happen when visiting the initial solution, nor when I create a different new solution. Could it be something in my code? I've read through similar issues, but none could really provide an answer. Though, I did learn how to explore the debug options and exceptions.

rene
  • 41,474
  • 78
  • 114
  • 152
  • Check your exception options if they are marked to throw: https://bhrnjica.files.wordpress.com/2015/07/debug_exception1.png – Vagner Gon Jan 05 '18 at 23:13
  • Try using Rider: https://www.jetbrains.com/rider/ – MetaColon Jan 05 '18 at 23:26
  • My exception options look a little different (VS 15). But, they are all checked. I'm not sure what Rider is. Is it some kind of add-on? – Peter Nichols Jan 06 '18 at 00:11
  • 1
    You might have a `StackOverflowException` somewhere, see [How to debug a stackoverflowexception in .NET](https://stackoverflow.com/q/4733878). One nasty situation that can occur is when you have a stack overflow in a property getter or `ToString()` method **and display the property or object in the Watch or Locals Window**. This can cause VIsual Studio to break. Try getting rid of the Watch and Locals windows and see if you can debug. – dbc Jan 06 '18 at 01:22
  • Any PoC where can observe the behaviour? – Paweł Łukasik Jan 06 '18 at 08:44

0 Answers0