开发者

Viewing XmlTextwriter Content within debugger

开发者 https://www.devze.com 2023-04-05 17:39 出处:网络
I am working on some pretty complex code that is writing to a memorystream using an XmlTextwriter. Is there a way in Visual 开发者_C百科Studio debug to see the content of the memorystream/XmlTextwrite

I am working on some pretty complex code that is writing to a memorystream using an XmlTextwriter. Is there a way in Visual 开发者_C百科Studio debug to see the content of the memorystream/XmlTextwriter as I am stepping through code.


It's easy to get it from the MemoryStream:

Encoding.UTF8.GetString(stream.ToArray())

(That's assuming you've told it to use UTF-8; use Encoding.Unicode or whatever's appropriate if necessary.)

It doesn't make as much sense to ask the XmlTextWriter - it's just writing data, and probably doesn't know or care what it's already written. You may want to flush it, mind you.

0

精彩评论

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