Blazor - Default Template with .NET 5.0, no menu

Hello koalas

Today I got this error:

It happened after I've decided to run my website in "Production" environment.

I find out after searching online that it was a bug or maybe an omission from Microsoft... (source).

The Solution

If you cannot see the navigation menu as well, when you open the default Blazor template with .NET 5.0, you have to add this line in your code in program.cs file:

webBuilder.UseStaticWebAssets();

It should look like this:

Result:

I hope you enjoyed this tiny article.

Didier