vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Debugger: Support Edit and Continue/Hot Reload

Open AmberZhang2016 opened this issue 9 years ago • 96 comments
trafficstars

Environment data

dotnet --info output: VS Code version:1.2.1 C# Extension version:1.1.7

Steps to reproduce

  1. We add following code to update the value of one variable when break mode: a++;
  2. then save the updated file;
  3. 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 avatar Jun 29 '16 03:06 AmberZhang2016

@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 avatar Jun 29 '16 05:06 gregg-miskelly

@gregg-miskelly, +1

Any news?

ghost avatar Feb 12 '18 18:02 ghost

Very interested in something like this. Working from macOS with dotnet can be tough, this would really aid in the development process

node-gs avatar Feb 28 '18 00:02 node-gs

+1

ikourfaln avatar Apr 26 '18 23:04 ikourfaln

+1

theSdev avatar Apr 30 '18 05:04 theSdev

+1

Recently discovered dotnet watch with .net core. Having the same functionality with the addition of debugging would be great!

murr4y avatar May 18 '18 09:05 murr4y

+1

frystpingvin avatar May 28 '18 11:05 frystpingvin

+1

hsinyu-chen avatar May 29 '18 10:05 hsinyu-chen

+1

JorgeGarciaIrazabal avatar Jun 03 '18 03:06 JorgeGarciaIrazabal

+1

thorgod avatar Jun 15 '18 22:06 thorgod

+1

iuribrindeiro avatar Jul 01 '18 02:07 iuribrindeiro

+1

marcantoinecouture avatar Jul 02 '18 19:07 marcantoinecouture

+1

eluchsinger avatar Jul 17 '18 09:07 eluchsinger

+1

vanmxpx avatar Jul 27 '18 09:07 vanmxpx

+1

G43beli avatar Aug 05 '18 20:08 G43beli

+1

blendsdk avatar Aug 17 '18 13:08 blendsdk

+1

mohamad-xtouch avatar Aug 24 '18 07:08 mohamad-xtouch

+1

glazjoon avatar Aug 30 '18 12:08 glazjoon

+1

Guybrush21 avatar Sep 10 '18 17:09 Guybrush21

"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

sgentile avatar Sep 14 '18 19:09 sgentile

:) Not yet. But thanks for voting. The more votes the easier it will be to get funding for the project.

gregg-miskelly avatar Sep 14 '18 19:09 gregg-miskelly

+1

amararias avatar Sep 26 '18 08:09 amararias

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 avatar Nov 09 '18 15:11 bitbonk

@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 avatar Nov 09 '18 16:11 gregg-miskelly

@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.

bitbonk avatar Nov 09 '18 18:11 bitbonk

I thought VS added support for remote managed EnC, but I could be remembering wrong...

gregg-miskelly avatar Nov 09 '18 18:11 gregg-miskelly

@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.

bitbonk avatar Nov 09 '18 21:11 bitbonk

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.

gregg-miskelly avatar Nov 09 '18 22:11 gregg-miskelly

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

bitbonk avatar Nov 10 '18 08:11 bitbonk

To be clear - that is due to the way EnC works, not because of anything to do with the environment variable.

gregg-miskelly avatar Nov 10 '18 16:11 gregg-miskelly