diff --git a/EssentialCSharp.Web/Program.cs b/EssentialCSharp.Web/Program.cs index 4fffe529..fac9c3a2 100644 --- a/EssentialCSharp.Web/Program.cs +++ b/EssentialCSharp.Web/Program.cs @@ -532,6 +532,11 @@ await McpJsonRpcResponseWriter.WriteErrorAsync( app.MapFallbackToController("Index", "Home"); + // Construct content-backed singletons now so an unreadable content file fails startup (the new + // revision never takes traffic) instead of surfacing as a 500 on the first page request. + app.Services.GetRequiredService(); + app.Services.GetRequiredService(); + // Validate sitemap data at startup — logs errors but allows startup to continue var siteMappingService = app.Services.GetRequiredService(); var logger = app.Services.GetRequiredService>();