I have been trying to fix this issue but have come up short. And I don't seem to have any luck looking for tutorials on doing HOSTED blazor wasm projects in dotnet that addresses my issue.
I'm using VSCODE. The issue is that I can debug the server side code just fine. But not the client side code. Despite there being two sessions in my call stack.
Here are the step I took to encountered this issue:
- Installed DotNet 6.
- I created a new project (Blazor Wasm Hosted)
dotnet new blazorwasm -ho -au Individual -p
. - Installed Chrome
- Created a self Signed Certificate (and made Chrome accept it).
- Opened the project in VSCode installed the C# and BlazorWasm debugging extensions
- After VSCode created the task.json and launch.json files. I tweaked them to run from the server project and open in Chrome.
- Run/Debug my config to launch "hosted blazor wasm app"
The problem is:
- If I put a breakpoint in Server/WeatherForecastController.cs. The breakpoint will hit.
- If I put a breakpoint on Client/Pages/Counter.razor. The breakpoint doesn't hit. And when I mouse over the breakpoint it says: "No symbols have been loaded for this document".
Here is the project's github page: https://github.com/cyberyaga/TerritoryWeb
Here is my launch.json configuration:
{
"name": "Launch and Debug Hosted Blazor WebAssembly App",
"type": "blazorwasm",
"request": "launch",
"hosted": true,
"browser": "chrome",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Server/bin/Debug/net6.0/TerritoryWeb.Server.dll",
"cwd": "${workspaceFolder}/Server",
"url": "https://localhost:7230"
}
Here is my dotnet info:
dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff
Runtime Environment:
OS Name: manjaro
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /usr/share/dotnet/sdk/6.0.100/
Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa
.NET SDKs installed:
6.0.100 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
I tried looking to see if I missed anything in my launch.json. But so far, I've not gotten Client side to hit. Despite there being two separate sessions in my call stack.
UPDATE
After doing some actual development on the project. I kind of have an idea as to what might be happening. If I debug in VSCODE (F5). I noticed that my "Client" project isn't getting built. I have to manually do a dotnet build
or a dotnet run
so that the client project gets updated. That might be why debugging doesn't work on the client. Seems like the source and compiled versions don't match.
UPDATE #2
So, I decided to test this on another distro. I tried doing this in Ubuntu 21.10... And both Server and Client debugging works as expected. Not sure what the issue is. I personally don't like Ubuntu as a distro, but I guess I will use it for the time being.
I would still like to know what's causing this, so that I can get it working in Manjaro.