murugaratham/vscode-dotnet-watch

No process with the specified id is currently running

Closed this issue · 3 comments

Sometimes while editing files (while the .NET Watch debugger is running), I'll be typing and get this popup:

screenshot 2022-03-01 at 15 48 39

When it happens, it usually happens a few times in a row. Any idea what is triggering this? It's not even when hitting CTRL+S or saving the file, it's just while I'm editing a file (usually a .cs file).

interesting, is it possible to give a repro for me to look at? I haven't been able to reproduce this behavior.

How this extension works (in essence):

Generates a task (instead of having you to create tasks.json yourself), start and add it to cache.

Running a Timer (SetInterval) to scan for processes in cache, started by us to attach every second. AttachDotNetDebugger

there's this:
debug.onDidTerminateDebugSession(DebuggerService.TryToRemoveDisconnectedDebugSession);, which means we hook onto vscode's on any termination of a debug session, we will populate the cache of disconnected debug sessions.

AttachDotNetDebugger will:

  • Check if the intended process is not in both running debugs and disconnected debugs
  • if so, we will add it running debugs and start a debug session
  • if intended process is in disconnected debugs

2.2 terminate the task

@murugaratham Unfortunately so far I've only experienced this in a repo I can't share, but I'll let you know if I can get it happening in a test repo.

I think things start to go wrong if the dotnet process crashes, and then your extension doesn't realize it?

Do you have auto save enabled or any extensions that might do it?

Also, if you have vs code integrated terminal in view, do you see if dotnet watch is restarting?