Visual Studio 2005 Web Site Project- "Edit and Continue" is too restrictive.

I have a solution with Start ASP.NET project and several VB and C# library projects. When I stopped in Visual Studio 2005 debugger in the library class code, the file is shown with small “lock”.
It doesn't allow me to do any changes, but show the message "Edit and Continue"
"Changes are not allowed when the debugger has been attached to an already running process or the code being debugged is optimized".
None of of these conditions is actually applicable for my case. Library is included in the solution, referred in Web Site project as Project and should allow me to edit it.
I've posted this as a suggestion under MS Feedback site , but it's more a bug, because it makes "Edit and continue" feature  more limited then it was in Visual Studio 2003.

There is a thread in “vsnet.debugging” group, where Jeffrey Tan from MS Online Partner Support  recommends “to stop the debug , change the source code in class library, then re-start the debugging again. This is the behavior of VS.net2003”. This is not correct, because VS.net2003 allowed to do modifications and continue, but changes were not in affect until the next restart.

Update: It seems that restriction is only applicable to VB libraries and C# libraries code can be edited during debugging.

“Workaround”: I found some unconvinient procedure, that allow to continue without stopping debugging.
1. Disable “Edit and Continue“.( If you didn't apply hotfix 915038 or VS 2005 Service Pack 1, it  should be disabled anyway -see bug FDBK40283 ).

2.When you stopped in debugger on a particular line and want to change a file 

3. Right-mouse click the file name on the tab caption and click “Copy full path“ menu

4.Start another instance of “Visual Studio 2005“ (or any another external editor).

5.Click “Open“ icon and paste file full path. Open the file and make the changes.

6.In the debugger close the file, that is editing in another editor.It is important, otherwise VS IDE will ask to reload the file with changes and can stop debugging anyway.

7. Save the changes in the editing instance of Visual Studio 2005“ (external editor).

 

posted @ Monday, January 9, 2006 10:59 AM
Print

Comments on this entry:

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by Stephen at 11/22/2006 3:04 AM
Gravatar
Thanks! Was wondering about this. How they could screw up Edit and Continue any more than it already was is beyond me.

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by Oliver at 4/3/2007 2:17 AM
Gravatar
I have this problem, but all my projects are C# However one project is a wrapper for a VB6 dll. Would this be the issue? If I refferrence just the dll and not the projects would this be another work around? The projects I referance are mostly maintained by another team. So could just get thier latest build instead of referencing the project.

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by Michael Freidgeim at 4/3/2007 9:26 PM
Gravatar
Oliver,

Actually my note that C# libraries code can be edited during debugging is not 100% accurate.
It is editable more often then VB code,but sometimes( I am not always understand which conditions trigger the behavior) it is also read-only.
Ensure that your libraries are referred from startup project as PROJECT References.
For ASP.NET I recommend to use WAP type of project, which has Edit&Continue support.

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by Divyanshu at 9/30/2007 11:38 PM
Gravatar
Thanks for such a wonderful trick.

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by Frank Hali at 10/23/2007 12:14 PM
Gravatar
I also experienced this document locking problem with C# which is a real pain after using C++ which works correctly. By turning off the 'edit & continue' in C# I can now edit source code while the debugger is running. It appears the 'edit and continue' is inverted (at least for my install).

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by Erich Eichinger at 11/23/2007 11:41 PM
Gravatar
Tx a lot!!!!! - I've been struggling w/ this annoying "feature" since the beginning of vs2005. Disabling "Edit & Continue" helped.

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by JT at 1/31/2008 5:31 PM
Gravatar
I mentioned this at Sydney .Net user group, using another instance of the IDE. MEh I want a fix not a workaround. VB6 had excellent Edit and continue, we have reflection in .Net WTF is Microsofts excuse???

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by Viktor at 3/13/2008 8:23 PM
Gravatar
Just like in the case above 'edit and continue' was inverted in my case also. Thanks, Frank

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by Aaron at 5/1/2008 10:11 PM
Gravatar
I agree, edit and continue is way too restrictive for C# (VS 2005 and 2008). To be honest, VS .NET kinda feels like a beta version that they gave up on adding useful features to. Its nothing like what VC6 had more than a DECADE ago.

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by amrut raval at 5/8/2008 6:04 PM
Gravatar
hello sir,

does it possible to run time Editing code in c# like vb6?

i am doing "Edit and Continue" feature of debugging disable and can do Edit code during run time. but, that Effect cant applies at that time like VB6. mean Restart debugging must Require .

thanks in advance.
i am Eagerly waiting for your suggetion

Amrut kumar D. Raval
(C# application developer)

# re: Visual Studio 2005- "Edit and Continue" is too restrictive.

Left by Michael Freidgeim at 5/8/2008 11:23 PM
Gravatar
Hi amrut raval,
If you are using ASP.NET WAP project(not Web Site project) and Development Server(aka Cassini)(not IIS), Edit&Continue is working quite good in VS 2005(didn't try VS 2008 yet). However some changes require restart(e.g. adding new function or changing parameters of existing function. But editing code within functions allows to continue.
Also consider to use Windows .net test harness http://geekswithblogs.net/mnf/archive/2006/07/06/84202.aspx

# re: Visual Studio 2005 Web Site Projetc- "Edit and Continue" is too restrictive.

Left by Federico Colombo at 6/16/2008 5:33 AM
Gravatar
THE SOLUTION:

Project properties...
In the "Compile" tab, Click "Advanced Compile Options", and UNCHECK "Enable Optimizations"

# re: Visual Studio 2005 Web Site Projetc- "Edit and Continue" is too restrictive.

Left by VJ at 6/19/2008 6:22 AM
Gravatar
I can't find "Compile" tab vs.net 2005. Ar you talking about vs6 or vs.net 2005? I thought this tread deal with vs.net 2005. Hmmm...

# re: Visual Studio 2005 Web Site Projetc- "Edit and Continue" is too restrictive.

Left by Michael Freidgeim at 6/29/2008 3:36 PM
Gravatar
VJ,
I beleive,Federico Colombo refers to Visual Basic(VB) Project . See discussion at http://forums.msdn.microsoft.com/en/vbide/thread/5fb1ada3-9c59-478d-a18f-8aa39a58ca81/

# re: Visual Studio 2005 Web Site Project- "Edit and Continue" is too restrictive.

Left by Aki at 12/22/2008 8:31 PM
Gravatar
To resolve the problem (Edit and Continue stopped working ) is very simple.
All you need to do is :
1) select your start-up project in solution explorer => right mouse click => Properties
2) Go to "Build" tab and uncheck "Optimize code" check box.

It's all :-)
enjoy your Debugging again

PS make shure that in Tools => Options => Debugging => Edit and Continue "enable edit and continue" check box is enabled.

# re: Visual Studio 2005 Web Site Project- "Edit and Continue" is too restrictive.

Left by Michael Freidgeim at 12/27/2008 12:43 AM
Gravatar
Aki,
The conditions of the issue- start ASP.NET web site and editing library projects. AFAIK- it is still limitation in VS 2008.

# VS2008 issue & fix

Left by Code Monkey at 5/30/2009 7:19 AM
Gravatar
Another issue, for those googling this error message, is that when VS2008's standard toolbar says you're in "Debug" that does not necessarily mean you're in Debug mode. Right click your solution and check the Configuration Manager... it is possible for any or all of your projects to be in Release mode when your solution is in Debug mode.

# re: Visual Studio 2005 Web Site Project- "Edit and Continue" is too restrictive.

Left by grovie at 9/3/2009 4:40 AM
Gravatar
Federico Colombo- <THE SOLUTION:

Project properties...
In the "Compile" tab, Click "Advanced Compile Options", and UNCHECK "Enable Optimizations">

worked a charm for me, cheers

# re: Visual Studio 2005 Web Site Project- "Edit and Continue" is too restrictive.

Left by mike salvidio at 11/30/2009 7:01 PM
Gravatar
been perplexed by this for a while now. finally spent the whole day trying to figure it out. the comments here were helpful but didn't work for me. i finally found an article at:

http://msdn.microsoft.com/en-us/library/7932e88z.aspx

and after a little work, i'm now doing edit and continue in vs2005 for vb.net projects. i did have to create a new debug configuration for x86 cpu, had to limit the debugging to native code only (turned off managed and sql server) and i also had to remove my web app and deployment app from the solution.

# re: Visual Studio 2005 Web Site Project- "Edit and Continue" is too restrictive.

Left by yisman at 7/4/2010 8:15 AM
Gravatar
hi
in vwd 2010 i cannot edit my aspx files whiile debugging. i could edit vb files but not aspx markup
edit and continue is enabled
there r no such "optimization" options in the properties as far as i can see.
please advise ( i had no problems in vwd 2008)

Your comment:



(not displayed)

 
 
 
 

Live Comment Preview:

 
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910