-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
Issue description
In my Blazor Server application I'm trying to statically set the culture for every user (to en-GB). I found the following guidance: https://learn.microsoft.com/en-us/aspnet/core/blazor/globalization-localization?view=aspnetcore-8.0#statically-set-the-server-side-culture
However it is not clear to me where to add app.UseRequestLocalization("en-GB");
. The document says "immediately after Routing Middleware". But as far as I can see Blazor Server does not add any Routing Middleware?
Below is the whole Program.cs from the Template:
using BlazorApp2.Components;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();
I am also hosting the application in IIS, having set the Application Pool as follows:
The Identity is a an account, with limited access.
What is your recommendation?
Software versions
Check the .NET target framework(s) being used, and include the version number(s).
- .NET Core
- .NET 5.0 or later
- .NET Framework
- .NET Standard
Metadata
Metadata
Assignees
Type
Projects
Status