Root cause: App.razor was in CentralUI (Microsoft.NET.Sdk.Razor RCL) but MapRazorComponents<App>().AddInteractiveServerRenderMode() serves _framework/blazor.web.js from the host assembly (Microsoft.NET.Sdk.Web). Per MS docs, the root component must be in the server (host) project. - Move App.razor and Routes.razor from CentralUI to Host/Components/ - Add Host/_Imports.razor for Razor component usings - Make MapCentralUI generic: MapCentralUI<TApp>() accepts root component - Add AdditionalAssemblies to discover CentralUI's pages/layouts - Routes.razor references both Host and CentralUI assemblies - Fix all DI registrations (TemplateEngine services) - SCADALINK_CONFIG env var for role-specific config loading Verified: blazor.web.js HTTP 200 (200KB), login page renders with Blazor interactive server mode, SignalR circuit establishes, LDAP auth works.
43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using ScadaLink.TemplateEngine.Flattening;
|
|
using ScadaLink.TemplateEngine.Services;
|
|
using ScadaLink.TemplateEngine.Validation;
|
|
|
|
namespace ScadaLink.TemplateEngine;
|
|
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddTemplateEngine(this IServiceCollection services)
|
|
{
|
|
services.AddScoped<TemplateService>();
|
|
services.AddScoped<SharedScriptService>();
|
|
|
|
// Flattening services (stateless utilities)
|
|
services.AddTransient<FlatteningService>();
|
|
services.AddTransient<DiffService>();
|
|
services.AddTransient<RevisionHashService>();
|
|
|
|
// Validation services (stateless utilities)
|
|
services.AddTransient<ScriptCompiler>();
|
|
services.AddTransient<SemanticValidator>();
|
|
services.AddTransient<ValidationService>();
|
|
|
|
// Domain services (depend on scoped DbContext / repositories)
|
|
services.AddScoped<InstanceService>();
|
|
services.AddScoped<SiteService>();
|
|
services.AddScoped<AreaService>();
|
|
services.AddScoped<TemplateDeletionService>();
|
|
|
|
// Note: CycleDetector, CollisionDetector, LockEnforcer, and TemplateResolver
|
|
// are static utility classes and do not require DI registration.
|
|
|
|
return services;
|
|
}
|
|
|
|
public static IServiceCollection AddTemplateEngineActors(this IServiceCollection services)
|
|
{
|
|
// Phase 0: placeholder for Akka actor registration
|
|
return services;
|
|
}
|
|
}
|