Logo

Remove Startup Validation

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.

Recommended to Keep
Startup validation catches configuration errors early, before they cause runtime failures. Consider keeping it unless you have a specific reason to remove.

What Startup Validation Does

Step 1: Remove Validation Registration

In Program.cs, locate and remove the startup validation service registration:

// DELETE: Startup validation
builder.Services.AddStartupValidation();

Step 2: Delete Validation Classes

Delete the startup validation files from the Startup/ folder:

Step 3: Delete Startup Problems Page and Middleware

Delete these files:

Also remove the middleware registration from Program.cs:

// DELETE: App unavailable middleware
app.UseMiddleware<AppUnavailableMiddleware>();

Step 4: Remove StartupValidationState References

Search for StartupValidationState in your code and remove all references. Check:

Step 5: Remove Validation-Related Configuration

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
}

Alternative: Simplify Validation

Instead of removing validation entirely, consider simplifying it:

Consequences of Removal

Without startup validation:

Verification

After removal, verify: