1

I created a new hosted Blazor WebAssembly project with dotnet cli without modifying any files, I opened the project with Visual Studio Code and it asks me to add files for debugging. I pressed Yes and two .json files are created in the .vscode directory. Why am I getting a message saying "Browser cannot start ..." when I start the project with F5 and the debug doesn't work? I have already tried to follow the official documentation but the debugger does not work. I have installed C # Debugging Extension and Blazor WebAssembly with no success. Thank you.

PS. I'm sorry for my english. :-)

  • Hey Marco, what version of net core and Visual Studio are you using ? The debug in blazor-webassembly only work from net core 6... – Mårshåll Feb 15 '22 at 15:14
  • I use last .NET 6 and last Visual Studio Code. With Visual Studio 2022 community the debugger works fine –  Feb 15 '22 at 15:23
  • You can provide more details of which project is set to start and which code stretch you want to debug ? – Mårshåll Feb 15 '22 at 15:26
  • I'm sorry, now that I realized that you are trying to use Vscode. Have you tried to follow this documentation? [link](https://learn.microsoft.com/pt-br/aspnet/core/blazor/debug?view=aspnetcore-6.0&tabs=visual-studio) – Mårshåll Feb 15 '22 at 15:33
  • Thanks for replies. Yes I tried. –  Feb 16 '22 at 05:36
  • 1
    @Mårshåll I have set as startup project the "server project". I would debug the client pages. –  Feb 28 '22 at 16:30
  • I solved it, the problem was in the project configuration files in VS Code that were created outside the project folder (by VS Code). Thank you all for the help. –  Mar 08 '22 at 13:11
  • @MarcoSantoni I also had this problem. I found a workaround, see [my answer here](https://stackoverflow.com/a/72037574) for working config. – lonix Apr 28 '22 at 03:16

0 Answers0