microsoft/aspire · error

No embedded dashboard database schema scripts were found.

Error message

No embedded dashboard database schema scripts were found.

What it means

DashboardSqliteDatabase.LoadSchemaScripts scans the assembly's embedded resources for .sql scripts under the schema resource prefix and throws InvalidOperationException when none are found. This indicates the build/embed mechanism failed — the database cannot be initialized without its schema scripts.

Solutions

  1. Rebuild or reinstall the official Aspire.Dashboard package so embedded schema .sql resources are present
  2. Verify the assembly includes resources under the schema prefix (check with a resource listing tool)
  3. If using trimming/ILLink or custom packaging, ensure embedded resources are preserved

Example fix

// after: verify embedded schema resources exist before use
var asm = typeof(DashboardSqliteDatabase).Assembly;
var hasSchema = asm.GetManifestResourceNames().Any(n => n.EndsWith(".sql", StringComparison.Ordinal));
if (!hasSchema)
{
    throw new InvalidOperationException("Dashboard build is missing embedded schema scripts; reinstall Aspire.Dashboard.");
}
Defensive patterns

Strategy: try-catch

Validate before calling

var asm = typeof(DashboardSqliteDatabase).Assembly;
var hasScripts = asm.GetManifestResourceNames()
    .Any(n => n.EndsWith(".sql", StringComparison.Ordinal));

Try / catch

try
{
    await database.InitializeSchemaAsync();
}
catch (InvalidOperationException ex) when (ex.Message.Contains("No embedded dashboard database schema scripts"))
{
    // reinstall/repair the Aspire.Dashboard package
}

Prevention

When it happens

Trigger: Calling any API that triggers lazy schema-script loading when the assembly contains zero embedded resources matching SchemaResourcePrefix and the '.sql' suffix.

Common situations: A custom/partial build that excluded the embedded .sql resources; an assembly trimmed or repackaged in a way that dropped embedded resources; deploying an incorrectly built Aspire.Dashboard binary.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16). Data as JSON: /api/errors/a401b5fa3abe4d30. Report an issue: GitHub.

Appendix: source

Thrown at src/Aspire.Dashboard/ServiceClient/DashboardSqliteDatabase.cs:200

    {
        if (IsReadOnly)
        {
            throw new InvalidOperationException(message);
        }
    }

    private static IReadOnlyList<string> LoadSchemaScripts()
    {
        var assembly = typeof(DashboardSqliteDatabase).Assembly;
        // Numeric filename prefixes define execution order because later schema domains reference tables created by earlier scripts.
        var resourceNames = assembly.GetManifestResourceNames()
            .Where(name => name.StartsWith(SchemaResourcePrefix, StringComparison.Ordinal) && name.EndsWith(".sql", StringComparison.Ordinal))
            .Order(StringComparer.Ordinal)
            .ToArray();

        if (resourceNames.Length == 0)
        {
            throw new InvalidOperationException("No embedded dashboard database schema scripts were found.");
        }

        var scripts = new List<string>(resourceNames.Length);
        foreach (var resourceName in resourceNames)
        {
            using var stream = assembly.GetManifestResourceStream(resourceName)
                ?? throw new InvalidOperationException($"Embedded dashboard database schema script '{resourceName}' was not found.");
            using var reader = new StreamReader(stream);
            scripts.Add(reader.ReadToEnd());
        }

        return scripts;
    }

    private static bool ValidateSchemaVersion(SqliteConnection connection, IDbTransaction? transaction, int expectedVersion)
    {
        // Opening the database and setting WAL creates a valid SQLite file before the schema transaction
        // commits, so an interrupted first initialization leaves a file with no dashboard_schema table.

View on GitHub (pinned to 25830f84bd)