Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2013 ASP.NET can't modify the code while debugging

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?

like image 247
Michelh91 Avatar asked Nov 19 '13 10:11

Michelh91


1 Answers

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!

like image 85
Losbear Avatar answered Sep 28 '22 23:09

Losbear