Dan Scott
Dan Scott

Reputation: 564

Disable being able to edit code while debugging

Recently when I've been debugging my application, I've been able to write code into C# files when the application isn't in the broken state. I've tried totally disabling the "Edit and Continue" setting in the visual studio options but that doesn't seem to be working.

What I'm expecting to happen is when I'm debugging and I type into a C# file, I want that popup that says "Changes are not allowed while the application is running" prompting me to put a breakpoint in my code to apply changes during runtime while the application is in the paused state. I'm not sure if this was a change that was introduced into the latest 2019 build or if there's something wrong with my options. Any ideas on this one would be great.

For reference, this is the popup that I want:

enter image description here

and these are my settings:

enter image description here

and proof of the functionality that I don't want

enter image description here

Upvotes: 8

Views: 2890

Answers (2)

Postlagerkarte
Postlagerkarte

Reputation: 7117

According to the VS Team this works as designed:

This behavior you described is expected for Visual Studio 16.3. We went through several changes on Edit and Continue and now allow editing the code while the application is running. Any errors or warnings regarding your changes will show up at the Error List Window. In order to apply these changes, you simply have to be on a break state (e.g. break all or stop on a breakpoint) and continue from there.

Source: https://developercommunity.visualstudio.com/content/problem/768979/able-to-type-while-debugging.html

Upvotes: 5

doom
doom

Reputation: 1

Tools > Options > Debugging > General, select Edit and Continue in the right pane.

Upvotes: -2

Related Questions