Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to make changes to ASP.NET Code Behind while Debugging

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?

like image 552
Vignesh Kumar A Avatar asked Apr 10 '14 07:04

Vignesh Kumar A


People also ask

How do I fix unable to start debugging on web server?

Restart your Application Pool. Check that your Web Application folder has the right permissions. Make sure that you give IIS_IUSRS, IUSR, or the specific user associated with the Application Pool read and execute rights for the Web Application folder. Fix the issue and restart your Application Pool.

How do I turn off vs debugging?

To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.

How do I disable debug mode in Visual Studio code?

To enable or disable Just My Code in Visual Studio, under Tools > Options (or Debug > Options) > Debugging > General, select or deselect Enable Just My Code.


2 Answers

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.

like image 191
Hugh Webber Avatar answered Oct 30 '22 17:10

Hugh Webber


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

like image 22
SpiderCode Avatar answered Oct 30 '22 16:10

SpiderCode