- Home /
Editing code while debugging with Visual Studio
I'm looking for a way to no longer get the "Changes are not allowed while code is running" pop up whenever I edit some code w/ Visual Studio when debugger is attached and have it let me perform changes. This wasn't a problem with MonoDevelop, is there a way to setup VS for this?
As far as i know, no, is not possible.. i mean its illogical to be able to change code while is runnign... or at least i think it.
I'm not asking it to run the changed code (although that is something possible, called Edit and Continue) I just want to be able to change the file and then when I save, stop and start the unity editor again, it should be the new code. I shouldn't have to stop the simulation just to edit a text file. I often test more than one thing per run. This seems both inefficient and unnecessary (again, this was possible with $$anonymous$$onoDevelop)
You just have to deatach debuger. You can have application in Play mode and edit your code and it won't get updated until you save.
It's completely illogical to edit your code while debugging, what if there was an error in a line you deleted? VS would have to break on a line that doesn't exist which is of course impossible
Answer by Rickasheye · Sep 20, 2018 at 07:14 AM
I don't have it attached to unity so everytime I play in unity I can make changes to the code in VS then the game pauses in unity for a bit then the code updates idk just only press play in unity don't do it In VS?
Yea, I've had to do this but it's not optimal as far as productivity goes. Plus, some of the problems I often fix have components in multiple files. Having the ability to note changes in files while the game is running would be a big plus. Looking to see if there's a better way.