diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index e4940edb7b2bed..95a86902d1e02e 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -250,7 +250,10 @@ protected override async Task AcceptCommand(MessageId id, string method, J await AttachToTarget(id, token); if (!contexts.TryGetValue(id, out ExecutionContext context)) - return false; + { + // for Dotnetdebugger.* messages, treat them as handled, thus not passing them on to the browser + return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase); + } switch (method) { @@ -536,11 +539,8 @@ protected override async Task AcceptCommand(MessageId id, string method, J } } - //ignore all protocol extension messages not supported on .net6 - if (method.StartsWith("DotnetDebugger.", StringComparison.Ordinal)) - return true; - - return false; + // for Dotnetdebugger.* messages, treat them as handled, thus not passing them on to the browser + return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase); } private async Task CallOnFunction(MessageId id, JObject args, CancellationToken token) {