I need to compare the contents of a List for two runs for my program. What is the easiest way to copy the entire contents of the List manually from Visual Studio to notepad while stepping through the code. I can view the contents in QuickWatch. How can I copy all the elements?
Breakpoints are one of the most important debugging techniques in your developer's toolbox. You set breakpoints wherever you want to pause debugger execution. For example, you may want to see the state of code variables or look at the call stack at a certain breakpoint.
Right click on the player, then select Copy debug info from the menu. To share the debug information, paste it from your computer.
You can open the immediate window and run something like:
string.Join(", ", yourList)
or just
yourList
To open the immediate window: Debug -> Windows -> Immediate or the equivalent Ctrl+D, I
Simply type this into the immediate window:
File.WriteAllLines("foo.txt", yourList);
Or if it's a list of something other than strings:
File.WriteAllLines("foo.txt", yourList.ConvertAll(Convert.ToString));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With