5

I've created a new ASP.NET Web Application for my project. While debugging, Visual Studio is not allowing me to make changes to my code behind (default.aspx.cs).

When I try, I get the "Edit and Continue" dialog letting me know that "Changes are not allowed while code is running or if the option 'Break all processes when one process breaks' is disabled.

but I'm able to edit my default.aspx

Am I missing an option somewhere?

3 Answers 3

15
+500

I know exactly what you mean. Turn off "Enable Edit and Continue" setting (in tools->options->debugging->general). Now you can edit .aspx.cs Content while it's debugging on Local IIS.

Sign up to request clarification or add additional context in comments.

2 Comments

This worked for me, but maybe I am not understanding what is meant by "Enable". Can someone explain? It seems to that changing the setting does exactly the opposite of what I would expect based on its name. Initially, the option "Enabled edit and continue" was checked, and I was frustrated because I could NOT make changes and reload my page while debugging. Based on this answer, I then UNchecked the "Enable edit and continue" option and then I could edit and continue. Totally confused.
When it says Edit and Continue, it means pause the program, step, edit, step, edit. What we're doing is Edit while its running, Save and Refresh Browser.
5

You are allowed to changes ASPX page because this page is going to be rendered at client side and changes made in page will be directly affected to client browser.

But When you change in CodeBehind visual studio will not allow to change the code because your code needs to be compile again and dll generated to your application needs to be created again with the updated code. That is why it will not allow you to change it.

If you want to change code, you will have to stop the application, change code and run the application again.

If you want to change the value of defined variable at debug time then you can directly change it by moving cursor on it and reassigning value.

Another option to change the value of variable at debug time is from Immediate window.

If you still want to update the code then follow below steps :

  1. Right Click on the Project
  2. Select Properties
  3. Select Web in Right Panel
  4. Check 'Checkbox' at the bottom saying : 'Enable Edit and Continue'

Refer : http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/26/debugging-support-for-64-bit-edit-and-continue-in-visual-studio-2013.aspx

8 Comments

May be in previous days you would be using website not web application.
down voters. don't down vote the answer until you have strong reason to down vote it and try to provide comment.
Sorry I have used the same what i'm using now
oops sorry. have a look at my updated answer. hope it will help you.
No.. How can i have Project property in Web Application
|
2

Probably you need to change this when running and debugging multiple projects at the same time:

Break All Processes When One Process Breaks

http://blogs.msdn.com/b/zainnab/archive/2010/10/22/break-all-processes-when-one-process-breaks-vstipdebug0029.aspx

Perhaps yesterday, you was working only with one project and today you are debugging multiple projects. Thats the difference.

Anyway, first answer is good too.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.