Output a watched Visual Studio variable to a file

前端 未结 4 1891
迷失自我
迷失自我 2020-12-09 17:50

Is there a way in Visual Studio (2008 if it matters) that I can, in debug/break mode, write the contents of a variable to a text/XML file?

The scenario is that I ha

4条回答
  •  感情败类
    2020-12-09 18:28

    I think that my answer is pretty much the same as JamesPickrell's, but from the Immediate Window you could also do something like this:

    My.Computer.FileSystem.WriteAllText("c:\temp.txt",history,True)
    

    This would output the content of the "history" variable to a file called c:\temp.txt.

提交回复
热议问题