开发者

Silverlight -- Debug.WriteLine() not working for a long string

I have a longish (3626 chars) string. When I have in my code

Debug.Writ开发者_如何转开发eLine(myString);

it only writes the first part. How can I tell it to write the whole thing?


There is a limit to how long the string can be when your use Debug.WriteLine(). What you could do is simply break your string up and display each block individually.


The default character limit per line with Debug.WriteLine is 715 characters. If you want to print more than that, you will have to split the existing string in multiple lines, considering the existing threshold. You could also use a third-party logging framework to log the data outside the standard trace listener.


Cast the string to object and it won't truncate it, eg:

Debug.WriteLine((object)getlongstring(), "test");

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜