I'm having problems while debugging a blazor web assembly project.
Setup:
- WASM Blazor UI project
- Web API project which reference the WASM Project
- They both share the same port.
- I Only launch the Web API project and also get access to the blazor site. (which is odd to me)
I have those 2 line in my Web Api Project.
app.UseWebAssemblyDebugging();
app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
endpoints.MapControllers();
endpoints.MapFallbackToFile("index.html");
});
Launch Settings Web API:
"API": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"launchUrl": "",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Launch Settings Blazor WASM:
"Lab.Web": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
When I try to put a breakpoint somewhere in my Blazor project. I get this message:
"The breakpoint will not currently be hit. No symbols have been loaded for this document."
I don't get this message if I run the Blazor project alone but then I don't have access to my Web API.
What is the correct way to share same port for Web API and Blazor WASM while being able to debug the WASM project??
ps: If this helps I'm using VS Studio 16.9.3.
Many thanks for your help!