开发者

Why is Visual studio referencing the wrong row during exceptions?

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:

Why is Visual studio referencing the wrong row during exceptions?

I know the line number is correct when you view details of the problem. However, I ofte开发者_如何学运维n 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?


This is apparently a known bug.


I am not sure that the bug @CodeNaked referenced is what you are experiencing. I know that I have gotten this a lot when debugging code that has changed and needs to be recompiled. I would try a clean and rebuild.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜