@manhng

Welcome to my blog!

Dump Object in C#

April 1, 2019 11:00

Dump Object in C# (edit)

Copy object values in Visual Studio debug mode:
I have an object name: userInfo
 
Press Ctrl + D, W to to to the Watch window
(new System.Xml.Serialization.XmlSerializer(userInfo.GetType())).Serialize(new System.IO.StreamWriter(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop),"text.xml")), userInfo)
Press Ctrl + D,I to go to the Immediate Window
(new System.Xml.Serialization.XmlSerializer(userInfo.GetType())).Serialize(new System.IO.StreamWriter(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop),"text.xml")), userInfo)
 

Categories

Recent posts