diff --git a/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs b/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs index 139f1f5..2ebd919 100644 --- a/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs +++ b/src/SharpIDE.Application/Features/Debugging/DebuggingService.cs @@ -57,9 +57,13 @@ public class DebuggingService { ; }); + debugProtocolHost.RegisterEventType(async void (@event) => + { + await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); // The VS Code Debug Protocol throws if you try to send a request from the dispatcher thread + debugProtocolHost.SendRequestSync(new DisconnectRequest()); + }); debugProtocolHost.RegisterClientRequestType(responder => { - var args = responder.Arguments; var signatureResponse = VsSigner.Sign(responder.Arguments.Value); responder.SetResponse(new HandshakeResponse(signatureResponse)); });