I'm developing a simple Blazor ASP.NET CORE Web Assembly project with Visual Studio Professional 2019 version 16.8.1 (the exception also happens in version 16.8.0).
Sometimes when I start the application I get a runtime error 'Failed to launch debug adapter Exception of type Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.ProtocolException
and the project won't start in the browser.
The browser the application is starting with is the new Microsoft Edge.
The message can be seen below:
Two possible workarounds that both independently worked for me:
I was seeing this error when Edge was set to my default browser on windows 10. Setting it back to Chrome and restarting VS allowed debugging to work again.
Uncheck the "Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE)" in "Tools > Options > Debugging > General" works for me.
source: developercommunity.visualstudio.com
As Richard Wrench mentioned - I switched over to debug using Firefox as well. I was using Chrome. The 'Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.ProtocolException' seems to have disappeared for me. Try it.
For me deleting .vs folder and rebuild did the trick.
The uncheck JavaScript debugging for ASP.NET did not work for me but switching to Canary works
Check if in the Configure method of the Startup.cs class in the Server Side there is the line app.UseWebAssemblyDebugging(). This worked for me.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerManager logger)
{
if (env.IsDevelopment())
{
app.UseWebAssemblyDebugging();
}
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With