Reputation: 61
When I create AspCore Hosted Blazor Wasm template project(VS22) and change server's launchSettings.json aspnetcore enviroment to "Production" or delete it entirely, page gets 404. It runs fine on "Development". Am i missing something? Do i need to configure anything else to run the app on production enviroment?
Upvotes: 5
Views: 697
Reputation: 51
In my case helped adding StaticWebAssetsLoader.UseStaticWebAssets()
to Program.cs
in BlazorApp.Server.proj
:
using Microsoft.AspNetCore.Hosting.StaticWebAssets;
...
var builder = WebApplication.CreateBuilder(args);
StaticWebAssetsLoader.UseStaticWebAssets(builder.Environment, builder.Configuration);
...
Upvotes: 3