Editing C# while debugging

10,607

Solution 1

Tools + Options, Debugging + Edit and Continue. Turn off the Enable checkbox. You can now edit the source code. You will get a warning when you continue to debug after you've made a change.

Solution 2

I am not sure why Edit and Continue won't work for you. If you are debugging and attached to the process you are debugging in, your pages should be locked or the debugger can't show you what is actively running.

Here is a reference to Edit and Continue. http://whyiamright.wordpress.com/2007/12/20/aspnet-edit-and-continue-in-visual-studio-2005/

If you are programming for the next build, it doesn't make sense to me to be trying to debug your current build.

Solution 3

The last time I had this problem I fixed it by changing the following settings:
Project properties -> Compile -> Advanced Compile Options -> Set "Generate debug info" to Full and uncheck "Enable optimizations".

Worked for me. Don't know about you, though.

Share:
10,607
Admin
Author by

Admin

Updated on August 01, 2022

Comments

  • Admin
    Admin almost 2 years

    I know I've dealt with this issue before, but the settings to override this always seem to be changing.

    I have a C# project in Visual Studio 2008. While I'm debugging, VS won't let me edit my code. I don't want to Edit and Continue - I just want to make changes for my next build. Edit and Continue is disabled. When I try to edit a file while debugging my project, I get a little message that the files are now Read-Only.

    Anyone dealt with this recently in VS2K8?