2

I've lost a lot of days on this and am hoping for some direction even if it is a different site to post on.

I am working on a Blazor Web Assembly application using VS 2022. About a week ago my debugger began no longer stopping on breakpoints in the client application. It does stop on the server app.

At the same time this problem started, I noticed that when I started a debug session it started opening a new tab rather than a new window in Edge; not sure if this is related.

A few points:

  • The behavior is consistent between MS Edge and Chrome.
  • If I create a new app, the new app stops on breakpoints.
  • I am on VS 2022. Tried it on VS2019 on the same laptop with the same results.

Been searching and finding little things to try here and there, but nothing has made a difference.

I can't think of any changes I have made to the environment, etc.

Hoping for some kind of guidance.

3
  • 1
    Is this an app that has been upgraded from 5 -> 6? If so you may want to compare the LaunchSettings.json in the Properties folder with the new app. Commented Jan 11, 2022 at 0:26
  • 1
    Have you tried closing VS and deleting the .vs, bin and obj folders from the solution? Commented Jan 11, 2022 at 2:20
  • I had a similar problem. I found a workaround, see my answer here for working config. Commented Apr 28, 2022 at 3:21

2 Answers 2

5

Thank you BP and MM for your help.

The problem ended up being in the LaunchSettings.json file on the server app. It was missing the line:

"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 

I have never updated this file and can only assume that it was there before because I have been debugging successfully for quite awhile. I have not upgraded from 5 => 6.

While I don't know the root cause, it is now working. Thanks again.

Sign up to request clarification or add additional context in comments.

2 Comments

This worked for me. Interestingly, Debugging was working and then suddenly it wasn't. I inspected the launchSettings.json file and this line was missing. Added it, and it started working again.
This worked for me too. inspectUri was missing in the server project's launchSettings.json in one of the profiles. Thanks!
1

I am late on this. But, I just had the same issue and fixed adding this "nativeDebugging": true to my LauchSettings.json. It looks like this:

"Dev": { "commandName": "Project", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, "dotnetRunMessages": true, "applicationUrl": "https://localhost:6003;http://localhost:6002;", "nativeDebugging": true }, 

2 Comments

Thank you Flavio. I did not have nativeDebugging set. I have added this and will see if it fixes the problem, and will post my results. Since this problem happens frequently, but not always, and since I don't know how to reproduce, if I get a few days without the probelm re-appearing, I will consider this a fix. Thanks again.
Thank you again Flavio. Unfortunately, this didn't seem to make any difference. Any other suggestions, including suggestions on other places to go for help would be greatly appreciated. Can't imagine the hit this has on productivity...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.