Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot write code in visual studio while debugging

Hi I have been shifted from VS 2013 to 2015 presently. So I am not too much familiar with in depth specifications.

I like VS 2015 as it allows me to evaluate lambda expressions and also it allow to me to change values runtime.

Scenario:

In some apps (winforms tested only) I am able to edit code while debugging and yes latest code is executed always i.e I don't need to stop and run the program again and againe. Yes it is very excellent feature.

But in case of my first experience at controller in MVC I am unable to edit code and it shows me multiple reasons behind this.

enter image description here

Can someone explain in what scenarios I can add/delete code while debugging?

Thanks in advance!

like image 457
Umar Avatar asked Nov 24 '16 09:11

Umar


2 Answers

In your visual studio go to Tools->Options-> expand debugging -> select Edit and continue and then check Enable edit and continue. here is image of that: see screenshot

like image 89
farrukh aziz Avatar answered Oct 01 '22 06:10

farrukh aziz


You normally cannot edit and continue if you attached to an already running process which maybe your case if you are attached to a running MVC web project. If something was load using Reflection you will not be able to edit it as well.

like image 21
Ignacio Soler Garcia Avatar answered Oct 01 '22 06:10

Ignacio Soler Garcia