vscode-csharp
vscode-csharp copied to clipboard
Debugger: Support Edit and Continue/Hot Reload
Environment data
dotnet --info output:
VS Code version:1.2.1
C# Extension version:1.1.7
Steps to reproduce
- We add following code to update the value of one variable when break mode: a++;
- then save the updated file;
- F10
Expected behavior
the new line will be executed and the value will be increased
Actual behavior
the new line is skipped and the value is not changed
@AmberZhang2016 Edit and Continue is a large and very connected feature which we don't have any immediate plans to bring to VS Code. I will leave this open, and people feel free to '+1' this. But, just to be clear, it is at least going to be a while before we get to this.
@gregg-miskelly, +1
Any news?
Very interested in something like this. Working from macOS with dotnet can be tough, this would really aid in the development process
+1
+1
+1
Recently discovered dotnet watch with .net core. Having the same functionality with the addition of debugging would be great!
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
"But, just to be clear, it is at least going to be a while before we get to this."
2 years later... any luck :)
+2
:) Not yet. But thanks for voting. The more votes the easier it will be to get funding for the project.
+1
We have rather complex applications that control actual machines and it is extremely time consuming (think hours!) to restart them and bring the software and the machines back into the desired state before we can try the effects that changes have to the overall system.
Of course we have unit test and integration test and all that but often it is just needed to test/try/fix things with/on the actual production hardware.
With the classic .NET Framework this is not really an option because customers might not allow the installation of a debugger on the production PC that controls the machine.
With both the .NET Core debugger and VS Code being copy-deployable, this would actually become an option and it would be extremely cool to have this ability. It would be an absolute killer feature for us.
@bitbonk just as an FYI, you actually have been able to XCopy Visual Studio's remote debugger for a very long time now, in case that helps you.
@gregg-miskelly Yes I am aware of that, but last time I checked edit & continue was not possible. I'd love to be proven wrong though.
I thought VS added support for remote managed EnC, but I could be remembering wrong...
@gregg-miskelly I just checked again, and you are right. Edit&Continue on classic .NET (4.7.2) does indeed work with remote debugging even if the remote debugger is launched from a remote file share. But (and that's a big but for us unfortunately) you have to launch the application with the debugger, attaching it later does not allow Edit&Continue.
I wonder if it would theoretically be possible that it could work with attaching the debugger locally to a running process in .NET Core.
Technically the requirement is that the code must be Just-In-Time compiled with EnC enabled. The normal way to have that happen is to launch under a debugger. But if you don't mind giving up a bit of perf, you can run your app with the environment variable COMPLUS_ForceEnc=1 set, and then you can attach later and EnC.
Wow that‘s interesting info. I wasn’t aware of the environment variable. It seems to have some limitations though, most notably
If you make an edit after attaching you cannot detach the debugger; the debugger will terminate the process when you stop debugging
To be clear - that is due to the way EnC works, not because of anything to do with the environment variable.