How can I change my code while debugging it so when it breaks I'll see the original code?
I have a program that runs for hours or days, and I want to debug it. Meanwhile instead of waiting I want to keep working on it's code. But if I change the code I can't break my running session and see it's original code.
EDIT: I disabled the "Edit and Continue" feature in order to do so, because when it's enabled and the debugger is on, my solution gets "locked" and can't be changed.
You need two copies of your solution:
Now open two instances of Visual Studio:
You can safely have the "edit and continue" option enabled in your debugging instance, and use this functionality there - i.e. you can try a change in the original source code to see if it works as expected, and then apply the same change in the working copy of your solution.
This is the only way to do it. If you don't have the original source code apart, the debugger has no way to show you the original source code.
Note: you can open a new instance of VS with the original source code, and attach to the running process, and then detach from the process and close VS without interfering with the running application. See the options "Attach to process..." and "Detach all" of the "Debug" menu.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments