This guide explains how to remove the startup configuration validation that checks for proper setup (logo exists, OAuth credentials configured, etc.) before allowing the application to run.
In Program.cs, locate and remove the startup validation service registration:
// DELETE: Startup validation
builder.Services.AddStartupValidation();
Delete the startup validation files from the Startup/ folder:
Startup/StartupValidator.csStartup/StartupError.csStartup/StartupErrorCodes.csDelete these files:
Pages/StartupProblems.cshtml and .cshtml.csMiddleware/AppUnavailableMiddleware.csAlso remove the middleware registration from Program.cs:
// DELETE: App unavailable middleware
app.UseMiddleware<AppUnavailableMiddleware>();
Search for StartupValidationState in your code and remove all
references. Check:
BWWebApplicationAuthWebApp.cs (validation failure notification)Middleware/AppUnavailableMiddleware.cs (request blocking)Pages/StartupProblems.cshtml (diagnostic page)In appsettings.json, you can remove validation-related settings
if they're no longer used:
// REVIEW: Are these still needed?
"Branding": {
"LogoPath": "...",
"LogoMaxWidth": 200, // DELETE if not validating
"LogoMaxHeight": 60 // DELETE if not validating
}
Instead of removing validation entirely, consider simplifying it:
Without startup validation:
After removal, verify: