ASP.NET Core Blazor server app not working
Hi,
I tried running the default Blazor server app that Rider creates and it doesn't run. It builds fine, but when I run it I get a blank page and if you view the source there's an error message " An unhandled exception has occurred. See browser dev tools for details.". I also get a bunch of warnings on project load:
12:03 Project 'WebApplication5' load finished with warnings
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) at (13:12)
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) at (14:12)
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) at (15:12)
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) at (16:12)
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) at (17:12)
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) at (18:12)
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) at (19:12)
Predefined type 'System.String' is not defined or imported at (13:55)
Predefined type 'System.String' is... (show balloon)
I'm on Ubuntu 19.10, running netcore 3.1
Please sign in to leave a comment.
Hello, Žiga,
Thanks for contacting us. Please, update Rider to the latest 2019.3, it should be already fixed.
Let me know if the problem persists. Thank you!
Hello,
It builds and runs now, although there still appear to be 2 linting errors:
1. In the file Shared/NavMenu.razor on line 11 "Cannot resolve symbol 'NavLinkMatch.All'"
2. In the file App.razor on line 3 Cammot resolve symbol 'routeData'
This is in the default generated ASP.NET core Blazor Server app
Thank you!
I reproduced this and created the issue RSRP-477434. Please, feel free to follow. As a workaround, you can temporarily disable these inspections.
I have installed Mono and Net Core 3.1 without errors.
Build my default Blazor WebAssembly project without errors.
And when I am trying to run it, i show this error.
22:25 Error running 'BlazingPizza': File /home/nesterovi/RiderProjects/BlazingPizza/BlazingPizza/bin/Debug/netstandard2.1/BlazingPizza.exe doesn't exist
I don't know, maybe deal in in new version of template
Hello Igor,
Could you please let me know if *.exe mentioned in error code can be found in the specified location? It is also a bit confusing that you mentioned you are using .NET Core 3.1 while in path there is netstandart2.1. Please check the run configuration to make sure it has the correct path to exe. Kindly keep me posted on the result.
I am running the default install template of
Microsoft.AspNetCore.Blazor.Templates::3.2.0-preview1.20073.1 also, on Mac.dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.2.0-preview1.20073.1dotnet run -- this runs okOpen project in Rider and cannot find a configuration to run project. Same error as Fasteat.
There is an existing configuration that has `target framework of: .NETStandard, Version=v2.1` with an exe path: ending in .exe, so the rider template being used is a .NET Project template as opposed to a Blazor server template using ".Net Launch Settings Profile" which uses settings in "launchSettings.json"
In a Blazor webassembly project there is no launchSettings.json; it wants an .exe file, but how for linux or mac?