Some simple rows of code below:
string[] countries = new string[1];
string[] cities = new string[1];
countries[0] = "USA";
countries[1] = "England";
cities[0] = "Chicago";
When Visual Studio throws the null exception it references the following row and not the row where the exception occurred:
I know the line number is correct when you view details of the problem. However, I often spend more time than necessary searching the wrong variables because the visual representation of the exception was wrong.
Is it possible to tweak VS or do something else to solve this issue? Is it a known problem or is it just me?
To change this setting for a particular exception, select the exception, right-click to show the shortcut menu, and select Continue When Unhandled in User Code. You may also change the setting for an entire category of exceptions, such as the entire Common Language Runtime exceptions).
In Visual Studio, when exceptions are thrown or end up unhandled, the debugger can help you debug these by breaking just like it breaks when a breakpoint is hit. In this blog post we will look at the different classifications of exceptions and how to configure when the debugger will break for those exceptions.
This is apparently a known bug.
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