Skip to content

Migrate AdminPanel and MapApp from 'Blazor Server App' to 'Blazor Web App' #675

@sven-n

Description

@sven-n

Is your feature request related to a problem? Please describe.
The AdminPanel structure and initialization must be modernized to be able to use new blazor features.
The AdminPanel project and depending web projects need to be migrated to the new way of doing blazor applications. It feels like some new and old features are mixed in the current codebase and it's very confusing to work with it.
The required steps are at: https://learn.microsoft.com/en-us/aspnet/core/migration/80-to-90?view=aspnetcore-8.0&tabs=visual-studio

Describe the solution you'd like
Following the guide, the AdminPanel needs to be adapted, so it's based upon an 'App.razor' file instead of '_Host.cshtml' and '_Layout.cshtml'.

The orchestration of the application must be adapted in the following locations:

  • MUnique.OpenMU.Web.AdminPanel.WebApplicationExtensions
  • MUnique.OpenMU.Web.AdminPanel.Host.Program
  • MUnique.OpenMU.Web.GameServer.Host.Program

Additional context
To have a clean reference project, start a new project 'Blazor Web App' in Visual Studio 2026.
E.g. new:

using BlazorWebApp.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.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
app.UseHttpsRedirection();

app.UseAntiforgery();

app.MapStaticAssets();
app.MapRazorComponents<App>()
    .AddInteractiveServerRenderMode();

app.Run();

old:

using BlazorServerApp_Old.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
    app.UseExceptionHandler("/Error");
    // 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.UseRouting();

app.MapBlazorHub();
app.MapFallbackToPage("/_Host");

app.Run();

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions