Copy object values in Visual Studio debug mode

前端 未结 12 512
轻奢々
轻奢々 2021-01-29 19:17

In Visual Studio debug mode it\'s possible to hover over variables to show their value and then right-click to \"Copy\", \"Copy Expression\" or \"Copy Value\".

In case t

12条回答
  •  伪装坚强ぢ
    2021-01-29 19:37

    You can run below code in immediate window and it will export to an xml file the serialized XML representation of an object:

    (new System.Xml.Serialization.XmlSerializer(obj.GetType())).Serialize(new System.IO.StreamWriter(@"c:\temp\text.xml"), obj)
    

    Source: Visual Studio how to serialize object from debugger

提交回复
热议问题