C#运行时完全跳过代码行 - 为什么?

时间:2015-06-29 15:16:59

标签: c#

我在下面的线上加了一个断点。执行命中时没有任何反应。完全跳过该行和下一行。有人能告诉我这里发生了什么吗?我无法解决这个问题。

string correctName;
string testingonetwothree;
int indexOfSpace = 0;
TextInfo storeLocation = new CultureInfo("en-US", false).TextInfo;
foreach(StoreLocation sL in storeLocations)
{
    correctName = storeLocation.ToTitleCase(sL.name);
    correctName = correctName.Substring(9);
<BreakPoint Here>    indexOfSpace = correctName.IndexOf(" "); //I added this line but during runtime it's completely ignored. - I placed a break point and nothing happens.
    testingonetwothree = "Hello " + "world"; //After that I got paranoid and added this line to see if I was just being crazy.  This line is skipped as well.
    correctName = correctName.ToLower();
    correctName = char.ToUpper(correctName[0]) + correctName.Substring(1);
    sL.name = correctName;
    sL.state = LookUpFullStateName(sL.state);
}
return storeLocations;

0 个答案:

没有答案