次のコードの変数aのデバッガー表示は{11\n22} であると予想していましたが、{1122} です。
class A
{
public string Text;
public override string ToString()
{
return this.Text;
}
}
A a = new A();
a.Text = "11\n22";
変数ウィンドウにデバッガーが表示されます。
display string of the object "{1122}" // why not "{11\n22}" ?
a.Text "11\n22"
a.ToString() "11\n22"
VS2012 および VS2010 でテスト済み。私は今までこれに気づきませんでした。表示文字列で\n文字が省略されている理由を知っている人はいますか?
[DebuggerDisplay("Text")] を追加しても同じ結果が得られます。