In my project which is a hybrid project (in previous it was a web forms project that then we modified to use mvc pattern).
Now I want that in debug mode, I want to change something in my cs file, and then I want the changed code to run.
I've tried enabling and disabling tools -> options -> debug -> edit and continue checkbox part.
When it is enabled I can't change code in my project while debugging. When it is disabled I can change code but it does not affect on running part. for example.
int i = 0; if(i == 1) return 1; else return 2;
In debug mode I changed i
to 1
but it stil returned 2
, in the following code, only when I stop and re-run the debugger it takes affects.
int i = 1; if(i == 1) return 1; else return 2;
BTW I am using Visual Studio 2010 version.
For those who don't know about it, it allows you to edit code while you are debugging a running process, re-compile the code while the binary is still running and continue using the application seamlessly with the new code, without the need to restart it.
To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.
This wasn't my problem; running VS2017 RC2, I found that under Tools -> Options -> Debugging -> Just-In-Time - my "Managed Code" was deselected.
There was a warning "Another debugger has registered itself as the Just-In-Time debugger. Fix by enabling Just-In-Time debugging or running Visual Studio repair".
I had not registered any other debugging tools! So no idea why it unticked...
So the fix was simply to tick the "Managed" box....
None of the given answers worked. Here's what I did.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With