VS2010 SP2 x86 - Unable to Edit and Continue - by iwjcs

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 520179 Comments
Status Closed Workarounds
Type Bug Repros 4
Opened 12/14/2009 5:48:55 AM
Access Restriction Public


One of the main functionalities that we are waiting for in the VS2010 is the feature that enable the programmers to edit the ASP.NET Web Application source code while debugging it. It should apply to the main code and referenced libraries of the solution as well. We tried it of several ways in VS2008 and the only alternative we found was to convert our entire applications and libraries to Web Sites, that we understand are an archaic solution that prevent the Team to better manage the source code.
Well, now we are evaluating the VS2010 and seeing that the same behavior applies to it. 
Will this feature be enabled in VS2010 ASP.NET Web Applications or should we forget it?
Is it a bug or just a design behavior?
I would like to enphasise that "Enable Edit and Continue" and "Break all processes when one process breaks" settings are enabled in the Debug/Options.
Sign in to post a comment.
Posted by Alexandre San on 9/5/2010 at 9:23 AM
I'm unable to edit when a break point is reach.
the application is a webapplication and here is the message i'm getting:

Changes are not allowed in the following cases:
- when the debugger has been attached to an already running process.
- the code being debugged was optimized at build or run time.
- the assembly being debugged is loaded as domain-neutral.
- the assembly being debugged was loaded through reflection

none of this cases apply in my situation, or perhaps the optimized at run time but i dont think so.
of course the option "enable edit" is check at the web application settings and in vs.

i'm running win7 x64, vs2010 trial

I have tried every possibilities with the intelligent trace (on, off, checked with call infos and without)
nothing seams to get over this message.

I tried aswell to look for a hotfix or a workaround, but nothing here too.

thank you to support me.

Posted by John [MSFT] on 12/28/2009 at 4:57 PM
No problem. For web application projects (WAPs), you cannot edit while in "Run" mode because WAPs utilize the behavior of class libraries and the client project system, and the client project system edit and continue feature is not designed to recompile on the fly when the application is running. This is for a variety of reasons. The major reason being that for managed edit and continue, the code you're running must match the code that you're seeing, and there's no way to make this work if your target process is running. So if you made edits while you were running, your edits wouldn't have been applied and you would be in stale code if you stopped. Another complemetory reason is because only certain actions are actually "safe" to make at any given time (for example, you can't remove a function that is on the current call stack). Because of this, your application has to be broken so the debugger knows what set of edits is safe.

I realize the web is a little different, and in fact you can edit while running inside of a Web site since in that case, asp.net will detect the change on disk and when the page is hit again, it will generate another assembly, and that new module should get loaded by the debugger when the new code starts running.

Hope this helps.

John Dundon
Posted by iwjcs on 12/23/2009 at 3:42 AM
Hello John,
You are totally right!
If we put the breakpoint at some place in the code, we can really edit it.
So, if the purpose is to meet this feature, then it is ok. It is a interesting feature and we don't know that, sorry by our ignorance :)
But why we can't edit the code while it is in running as also when it are debugged?
It would be very nice and productive to the programmers if the code could be changed while running too.
Do you have any plan to implement this feature as well?
Thanks in advance,
José Carlos.
Posted by John [MSFT] on 12/22/2009 at 3:03 PM
Hi José Carlos,

Interesting. Are you sure you're trying to edit while at a breakpoint and not while running? Edit and continue is only supported while at a breakpoint; the dialog you're getting will be shown if you try to add code while running in a web application project. If you're not doing this while running, can you give me your specific steps you're using? For example, I'm seeing the following work for me on our Beta 2 build:

1. File > New Project, select C#, create a new Web Application
2. Go into the Default.aspx.cs file
3. Put a breakpoint at the Page_Load function
4. Open project properties, choose the Web tab, select "Enable Edit and Continue", hit save, close the property pages
5. Hit F5 on your Default.aspx
6. When the breakpoint is hit, try to create a new variable inside the Page_Load function by writing the following lines of code:

int i = 1;
i += 5;

7. Hit F10 (or hit step into)
8. See the new code get hit, you can hover over variables to get their values.

Posted by iwjcs on 12/22/2009 at 8:38 AM
Mr. Dundon, thanks for your feedback and excuse-me for the delay in the response.
I verified this option and it wasn't checked.
So I checked, but unfortunatelly didn't solve the issue. The result was the same.
Some other idea?
José Carlos.
Posted by John [MSFT] on 12/17/2009 at 10:27 AM
Edit and continue should be supported in web application projects when using the Visual Studio Development Server. However, in the project properties in the "Web" tab, there is also an option that says "Enable Edit and Continue". Can you verify that is checked?

John Dundon
Visual Web Developer Team
Posted by Microsoft on 12/17/2009 at 12:07 AM
Thanks for your feedback.

We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.
These specialized experts will follow-up with your issue.
Posted by DevDiv [MSFT] on 12/15/2009 at 7:17 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)