Getting ProtocolException runtime error Blazor project
Asked Answered
C

7

20

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:

enter image description here

Chufa answered 2/9, 2020 at 15:12 Comment(3)
Update: I'm using VS Community 2019 16.7 - After reading github.com/dotnet/aspnetcore/issues/22012, was able to switch browser to FireFox Dev. That works, but Chrome is still an issueChufa
I solved this issue by always closing all the tabs from Microsoft Edge (the browser I use to debug the web app) before starting the application. I realized that it only happens if the browser is open.Yser
reinstalling chrome solved for me, there was some sort of error in update,Studdard
B
10

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

Boschvark answered 8/1, 2021 at 14:34 Comment(2)
give me an error :' visual studio the debug adapter exited unexpectedly'Derickderide
Uncheck the "Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE)" in "Tools > Options > Debugging > General" works for me. Thanks a ton!Comyns
T
5

For me deleting .vs folder and rebuild did the trick.

Temporary answered 4/3, 2021 at 9:17 Comment(0)
F
4

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.

Fidel answered 14/1, 2021 at 4:24 Comment(0)
F
1

The uncheck JavaScript debugging for ASP.NET did not work for me but switching to Canary works

Fighterbomber answered 29/1, 2021 at 15:15 Comment(0)
F
1

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();
            }
         ...

Frustule answered 11/5, 2021 at 16:14 Comment(0)
S
0

Uncheck the Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE) in
Tools > Options > Debugging > General works for me.

Shawna answered 14/1, 2021 at 6:0 Comment(0)
M
-1

Apparently, this is such a big issue, @Matthias my defualt browser was actually set to Google Chrome, and I then set it to Edge. In addition I then set the debug browser to use FireFox @Richard Wrench. On top of all that, I also deleted the obj and bin folders of my project before restarting VS 2019 and rebuilding my project again. This added information is because the problem doesn't have a real fixed solution, so these extra steps may help as they did for me

Meredeth answered 26/2, 2021 at 13:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.