Reputation: 1507
we are using VS 2012 on Windows 7 with 32 bit operating system.
I have enabled "Edit and Continue" feature from Tools -> Options -> Debugging -> Edit and Continue.
still I am not able to edit .cs file in debug mode.
can somebody suggest what am I missing?
I kept the break point in one of mvc controller class. when it hit the break point, I tried to edit and got the below message:
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.
-When Intellitrace events and call information is enabled.
Upvotes: 3
Views: 2309
Reputation: 9289
Web application need to be compiled when web-sites is compiled dynamically when executed.
Edit and continue will not work in MVC kind of project. You need to put break point and compile whole project to debug your project.
Upvotes: 4
Reputation: 4151
Just to clarify some bits as it might help others..
1) The answer from [Gupta Anirudha F1beta] is correct
These below applies for Visual Studio 2012, 2013 + MVC 4, I was trying to edit Controller
2) If Edit & Continue is disabled, you cannot make changes in the *.cs code, you will see the message as [mmssaann] highlighted above. To edit your code, you need to stop debugging, edit your code and start debugging again to continue
3) If Edit & Continue is enabled, you can make changes in the *.cs code, BUT you will get a different message after you continue debugging saying Edit or Restart (so the website will be recompiled again). This approach is same as above but it seems a bit faster maybe you save like 1 click which makes in 50 years of coding like thousands of saved clicks :-)
I hope this helped :)
Upvotes: 8