Updated to 5.0 Issuse

Hi i updated my project to 5.0 And wanted to add support for Use Dialog, Notification, ContextMenu and Tooltip components

and flowed what the post on here and what the docs says but when running it i get this error and i cant seam to fin out why, when i set the rendermode to InteractiveServer

Error:

An unhandled exception has occurred while executing the request.
System.InvalidOperationException: A component of type 'Radzen.Blazor.RadzenTheme' has render mode 'InteractiveAutoRenderMode', but the required endpoints are not mapped on the server. When calling 'MapRazorComponents', add a call to 'AddInteractiveWebAssemblyRenderMode'. For example, 'builder.MapRazorComponents<...>.AddInteractiveWebAssemblyRenderMode()'

Program file:

public class Program
{
    private const string _appName = "MCC";

    public static void Main(string[] args)
    {
        try
        {
            Startup(args);
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Startup exception: {ex}");
        }
    }


    private static void Startup(string[] args)
    {
        // Initialize the logger
        Logger.SetupLogger();

        try
        {
            var stringBuilder = new StringBuilder();
            stringBuilder.AppendLine("Startup state:");
            stringBuilder.AppendLine($" {_appName} Ver: {Assembly.GetExecutingAssembly().GetName().Version}");
            stringBuilder.AppendLine($" CLR Ver: {Environment.Version}");
            stringBuilder.AppendLine($" OS: {Environment.OSVersion}");
            stringBuilder.AppendLine($" CPU Arch: {RuntimeInformation.ProcessArchitecture}");
            stringBuilder.AppendLine($" Processor Count: {Environment.ProcessorCount}");
            stringBuilder.Append($" Application User: {Environment.UserName}");
            Log.Information(stringBuilder.ToString());

            StartWebServer(args);

            Log.Information("Shutting down");
        }
        catch (Exception ex)
        {
            Log.Fatal(ex, "Host terminated unexpectedly");
        }
        finally
        {
            Log.CloseAndFlush();
        }
    }


    private static void StartWebServer(string[] args)
    {
        try
        {
            Log.Information($"Initializing {_appName}...");

            var app = CreateBuilder(args).Build();
            ConfigureWebApplication(app).Run();

            Log.Information($"{_appName} Web server stopped. Exiting");
        }
        catch (Exception ex)
        {
            Log.Fatal(ex, $"{_appName} Web server terminated unexpectedly");
        }
    }


    private static WebApplicationBuilder CreateBuilder(string[] args)
    {
        var builder = WebApplication.CreateBuilder(args);

        // Get the IConfigurationBuilder instance
        IConfigurationBuilder configBuilder = builder.Configuration;
        var config = configBuilder.Build();

        // Add Services to the container
        builder.Host.UseSerilog();

        builder.Services.AddBackgroundJobs();

        builder.Services.AddAuth(config);

        builder.Services.AddControllersWithViews()
            .AddMicrosoftIdentityUI();

        // configure cultures
        builder.Services.Configure<RequestLocalizationOptions>(async options =>
        {
            var supportedCultures = new[] { "en", "dk", "fin" };
            options.AddSupportedCultures(supportedCultures);
            options.AddSupportedUICultures(supportedCultures);
        });

        builder.Services.AddSwagger();

        if (!builder.Environment.IsDevelopment())
        {
            AzureKeyVault.AddAzureKeyVault(configBuilder);
        }

        // Compress HTTP response messages (Recommenede when hosting SignalR Hubs)
        builder.Services.AddResponseCompression(opts =>
        {
            opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(
                  new[] { "application/octet-stream" });
        });

        builder.Services.Configure<ForwardedHeadersOptions>(options =>
        {
            options.ForwardedHeaders =
                ForwardedHeaders.XForwardedFor |
                ForwardedHeaders.XForwardedProto |
                ForwardedHeaders.XForwardedHost;

            options.KnownNetworks.Clear(); // Trust all networks
            options.KnownProxies.Clear(); // Trust all proxies
        });

        // MCC backend services
        builder.Services.AddScoped<IDomainEventDispatcher, DomainEventDispatcher>();
        builder.Services.AddApplicationServices(config);
        builder.Services.AddWebServices(config);
        builder.Services.AddPersistenceServices(config);
        builder.Services.AddInfrastructureServices(config, builder.Environment);

        // MCC UI services
        builder.Services.AddRazorPages();
        builder.Services.AddRazorComponents()
            .AddInteractiveServerComponents()
            .AddMicrosoftIdentityConsentHandler();
        builder.Services.AddAutoFocus();
        builder.Services.AddI18nText();
        builder.Services.AddBlazoredModal();
        builder.Services.AddBlazoredToast();
        builder.Services.AddHotKeys2();
        builder.Services.AddRadzenComponents();

        builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
        builder.Services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();

        builder.Services.AddBlazoredLocalStorage();
        return builder;
    }


    private static WebApplication ConfigureWebApplication(WebApplication app)
    {
        // Configure the HTTP request pipeline.
        app.UseForwardedHeaders();

        // Custom middleware to use X-Forwarded-Port
        app.Use((context, next) =>
        {
            if (context.Request.Headers.TryGetValue("X-Forwarded-Port", out var port))
            {
                // Override the port with the value from the header
                var host = context.Request.Host;
                context.Request.Host = new HostString(host.Host, int.Parse(port));
            }

            return next();
        });

        if (app.Environment.IsDevelopment())
        {
            // Development seed data
            app.SeedDevelopmentData(app.Services);

            app.UseDeveloperExceptionPage();
            app.UseSwagger();
            app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "MCC v1"));
        }
        else
        {
            app.UseResponseCompression();
            app.UseExceptionHandler("/Error");
        }

        app.UseSerilogRequestLogging();

        app.UseStaticFiles();

        app.UseRouting();

        app.UseAuthentication();
        app.UseAuthorization();

        app.MapControllers();
        app.MapRazorComponents<App>()
            .AddInteractiveServerRenderMode();
        app.UseAntiforgery();

        // Map API endpoints
        VikingRobotCellEndpoints.Map(app);
        TesterEndpoints.Map(app);
        SfcEndpoints.Map(app);
        OddShapeEndpoints.Map(app);
        SoapEndpoints.Map(app);
        NodeEndpoints.Map(app);

        return app;
    }

MainLayout:

@inherits LayoutComponentBase
@using Blazored.Toast.Configuration;
@using Blazored.LocalStorage;
@inject ILocalStorageService localStorage
@using Toolbelt.Blazor;
@inject ILogger<MainLayout> Logger

<PageTitle>MCC</PageTitle>

<RadzenComponents @rendermode="InteractiveServer" />
<BlazoredToasts Position="ToastPosition.BottomLeft"
                Timeout="10"
                IconType="IconType.FontAwesome"
                ErrorIcon="fa-regular fa-xmark"
                InfoIcon="fa-light fa-square-info"
                SuccessIcon="check"
                WarningIcon="fa-regular fa-triangle-exclamation"
                MaxToastCount="3"
                ShowProgressBar="true" />

<RadzenLayout Style="grid-template-areas: 'rz-sidebar rz-header' 'rz-sidebar rz-body'">
    <RadzenHeader>
        <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0">
            <RadzenSidebarToggle Click="@(() => sidebar2Expanded = !sidebar2Expanded)" />
            <PageHeader />
        </RadzenStack>
    </RadzenHeader>
    <RadzenSidebar @bind-Expanded="@sidebar2Expanded" class="bg-Menu">
        <NavMenu />
    </RadzenSidebar>
    <RadzenBody>
        <div class="rz-p-4">
            @Body
        </div>
    </RadzenBody>
</RadzenLayout>

NavMenu:

<RadzenPanelMenu Multiple="false">

    <RadzenPanelMenuItem Text="Home" Path="/" Icon="home"></RadzenPanelMenuItem>

    <AuthorizeView Roles="Administrator, Operators">
        <RadzenPanelMenuItem Text="Production Floor" Icon="donut_large">
            <RadzenPanelMenuItem Text="My Station" Icon="person_pin" Path="mystation"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="Start PCBA Order" Icon="forward" Path="startorder" />
        </RadzenPanelMenuItem>
    </AuthorizeView>

    <AuthorizeView Roles="Administrator, Production-Technicians">
        <RadzenPanelMenuItem Text="Information" Icon="info">
            <RadzenPanelMenuItem Text="All Stations" Icon="transfer_within_a_station" Path="allstations"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="Sfc Information" Icon="device_unknown" Path="sfcinformation"></RadzenPanelMenuItem>
        </RadzenPanelMenuItem>
    </AuthorizeView>

    <AuthorizeView Roles="Administrator">
        <RadzenPanelMenuItem Text="Equipment" Icon="construction">
            <RadzenPanelMenuItem Text="TorqueTool" Icon="tools_power_drill" Path="torquetool"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="Pick2Light" Icon="wb_incandescent" Path="pick2light"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="LabelPrint" Icon="label" Path="labelprint"></RadzenPanelMenuItem>
        </RadzenPanelMenuItem>
    </AuthorizeView>

    <AuthorizeView Roles="Administrator">
        <RadzenPanelMenuItem Text="Support" Icon="build">
            <RadzenPanelMenuItem Text="JobQueue" Icon="animation" Path="jobqueue"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="Graph Management" Icon="legend_toggle" Path="graphmanagement"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="Sfc Management" Icon="manage_search" Path="sfcmanagement"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="Sfc Traceability" Icon="query_stats" Path="sfctraceabilitydatasupport"></RadzenPanelMenuItem>
        </RadzenPanelMenuItem>
    </AuthorizeView>

    <AuthorizeView Roles="Administrator,  Production-Technicians">
        <RadzenPanelMenuItem Text="Configurations" Icon="tune">
            <RadzenPanelMenuItem Text="Capability" Icon="format_list_bulleted" Path="capabilityconfiguration"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="Label Print" Icon="label" Path="labelprintconfiguration" />
            <RadzenPanelMenuItem Text="Roboception" Icon="precision_manufacturing" Path="roboceptionconfiguration" />
            <RadzenPanelMenuItem Text="Torque Tool" Icon="build_circle" Path="torquetoolconfiguration" />
            <RadzenPanelMenuItem Text="Process Lot" Icon="input" Path="processlotconfiguration" />
            <RadzenPanelMenuItem Text="Manual Workstation" Icon="table_restaurant" Path="manualworkstationconfiguration" />
            <RadzenPanelMenuItem Text="Manual Tester" Icon="table_restaurant" Path="manualtesterconfiguration" />
            <RadzenPanelMenuItem Text="User Management" Icon="account_circle" Path="usermanagement" />
        </RadzenPanelMenuItem>
    </AuthorizeView>

    <RadzenPanelMenuItem Text="Help" Icon="help">
        <RadzenPanelMenuItem Text="Help" Icon="contact_support" Path="help"></RadzenPanelMenuItem>
        <RadzenPanelMenuItem Text="FAQ" Icon="quiz" Path="FAQ"></RadzenPanelMenuItem>
        <RadzenPanelMenuItem Text="Glossary" Icon="spellcheck" Path="Glossary"></RadzenPanelMenuItem>
        <AuthorizeView Roles="Administrator">
            <RadzenPanelMenuItem Text="User Profile" Icon="account_circle" Path="profile"></RadzenPanelMenuItem>
        </AuthorizeView>
    </RadzenPanelMenuItem>

    <AuthorizeView Roles="Administrator">
        <RadzenPanelMenuItem Text="3D Demo" Icon="view_in_ar">
            <RadzenPanelMenuItem Text="example 01" Path="example01"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="example 02" Path="example02"></RadzenPanelMenuItem>
            <RadzenPanelMenuItem Text="example 03" Path="example03"></RadzenPanelMenuItem>
        </RadzenPanelMenuItem>
    </AuthorizeView>

</RadzenPanelMenu>

<div class="container" style="position: absolute; bottom: 5px;">
    <div class="m-2">
        <RadzenButton Size="ButtonSize.Large" ButtonStyle="ButtonStyle.Secondary" Icon="settings" Click="OpenSettings" Class="rz-border-radius-10 rz-shadow-6"></RadzenButton>
    </div>
    <div class="m-2">
        <LoginDisplay />
    </div>
</div>


@code {
    public async Task OpenSettings()
    {
        var options = new SideDialogOptions { CloseDialogOnOverlayClick = true, Position = DialogPosition.Bottom, Width = "20%", ShowMask = false };
        await DialogService.OpenSideAsync<PageSettings>("Settings", null, options);
    }
}

any reason why and or how to fix this

Thanks :slight_smile:

You should use the correct render mode for your application which is not interactive but server. Follow the instructions:

Found the error in one of the Rendermodes Thansk :smiley: