diff --git a/src/Application/ApplicationServiceExtensions.cs b/src/Application/ApplicationServiceExtensions.cs index a794bd1..e073a8a 100644 --- a/src/Application/ApplicationServiceExtensions.cs +++ b/src/Application/ApplicationServiceExtensions.cs @@ -35,7 +35,9 @@ public static IServiceCollection AddApplication(this IServiceCollection services // Settings services.AddScoped(); services.AddScoped(); - services.AddScoped(); + // NB: TestArrConnectionHandler is registered by the Web host only — it needs IArrClient, which + // only a host that calls AddArrClient() provides. Registering it here made every host fail to + // start under DI validate-on-build (i.e. in Development). // Auth (#48) — SetupToken is a singleton so it survives for the process lifetime and is // logged once at startup; the handlers are scoped like every other use-case. diff --git a/src/Presentation/Web/Program.cs b/src/Presentation/Web/Program.cs index 32a75ce..4bfc410 100644 --- a/src/Presentation/Web/Program.cs +++ b/src/Presentation/Web/Program.cs @@ -1,6 +1,7 @@ using System.Threading.RateLimiting; using Krautwatch.Application; using Krautwatch.Application.Auth; +using Krautwatch.Application.Settings; using Krautwatch.Infrastructure; using Krautwatch.Web; using Krautwatch.Web.Components; @@ -13,6 +14,14 @@ var builder = WebApplication.CreateBuilder(args); builder.AddServiceDefaults(); + +// Load the static-web-assets manifest explicitly. The framework only does this in Development, and none of +// our hosts run as Development (there are no launch profiles, and Aspire does not set one), so +// _framework/blazor.web.js returned a 500 and compressed assets returned an empty 200 — the UI loaded +// unstyled and completely inert, with no error anywhere obvious. No-op when the manifest is absent, i.e. in +// a published app where the assets are copied into wwwroot. See #63. +builder.WebHost.UseStaticWebAssets(); + builder.Services.AddRazorComponents().AddInteractiveServerComponents(); var connectionString = builder.Configuration.GetConnectionString("krautwatch") @@ -25,6 +34,11 @@ }); builder.Services.AddApplication(); +// Outbound Sonarr/Radarr client + the Action that uses it. Paired deliberately: the handler cannot be +// constructed without the client, so whichever host wants one must wire both (#4). +builder.Services.AddArrClient(); +builder.Services.AddScoped(); + // ────────────────────────────────────────────────────────────── // Authentication (#48) //