5

I'm working with a ASP.NET 2.0 project that has been upgraded from vs 2005->2010->2013.

In vs 2005 and 2010 I can modify the code while debugging, save the changes, and reload the page with the changes applied.

Now in vs 2013 I can't do this. Can't change the code when I hit a breakpoint. Tried to activate all checkboxs in "Edit & Continue" options, but nothing worked.

It's annoying having to stop debugging and recompile the app to debug again the changes.

How can I solve this?

3
  • 2
    In 2012 you couldn't either. Sounds like a VB/C# thing. I think VB used to let you do that. I don't remember ever doing it with c# Commented Nov 19, 2013 at 11:04
  • 1
    Also does not work with 64bit apps: blogs.msdn.com/b/habibh/archive/2009/10/12/… Commented Nov 19, 2013 at 11:30
  • I upgraded last year to VS2013 Express for Web and also noticed Edit&Continue stopped working. I can E&C projects created in VS2012 with VS2012, but if I open those projects in VS2013 E&C won't work. I confirmed E&C is working in VS2013 by creating a new project in VS2013 and then E&C'ing - which worked fine. There must be something in the .proj file that is preventing it from working. Commented Feb 19, 2014 at 13:48

4 Answers 4

5

FINALLY figured it out. Here are my findings.

To Reproduce: I created 2 vanilla projects:

1) .net 4.0 project with VS2012 (ProjectA) 2) .net 4.5 project with VS2013 (ProjectB). 

Then opened ProjectA with VS2013 and I couldn't Edit & Continue (E&C).

Resolution:

In VS2013, go into the project's properties on the "Build" tab and uncheck "Optimize Code".

I still don't know why I could Edit & Continue in VS2012 even with "Optimize Code" checked, but in VS2013, it won't work.

Resources:

Here is the link that aided me in locating the problem:

http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(vs.debug.ENC.SupportedButNotAvaiable);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.0);k(DevLang-csharp)&rd=true

Hope this helps!

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

1 Comment

VS 2017 proj props Build tab doesn't have Optimize Code
3

I know this is a bit old, but I found the answer today - at least one answer. I'm running Visual Studio 2013 Update 1 and in my case, attempting to debug an MVC 5 application. Switch your target platform (in the Build menu) from Any CPU to either x64 for 64-bit or x86 for 32-bit.

I ran into this today while attempting to debug my MVC 5 application. After reading the release notes for Visual Studio 2013, including the fact that they added the ability in, I was puzzled. I checked my properties and saw that Optimize Code was unchecked while Edit & Continue were checked. The only other debugger marked was ASP.NET. On a hunch, I changed from targeting Any CPU to just targeting x64 under the Build menu. After that, I was able to use Edit and Continue as long as I wasn't attempting to edit lambdas or other items!

Comments

1

Find little solution for this case - close all files in solution before run debug. Only files which were closed when debug is started can be edit. Of file is opened when debug is start - edit is not possible.

Comments

0

What works for me, is the following:

1) Break point is hit, and I want to change code.

2) Now: Set next statement to somewhere earlier in the current function.

3) Do the change

4) Save / CTRL-s

5) Stepping through the function now includes the change.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.