{"record":{"id":"6dea17dd69bf94f4","repo":"microsoft/aspire","slug":"dashboard-path-empty-or-file-does-not-exist","errorCode":null,"errorMessage":"Dashboard path empty or file does not exist.","messagePattern":"Dashboard path empty or file does not exist\\.","errorType":"exception","errorClass":"DistributedApplicationException","httpStatus":null,"severity":"critical","filePath":"src/Aspire.Hosting/Dashboard/DashboardEventHandlers.cs","lineNumber":281,"sourceCode":"                            break;\n                    }\n                }\n            }\n        }\n\n        // Create a temporary file for the custom runtime config\n        var tempPath = directoryService.TempDirectory.CreateTempFile(\"runtimeconfig.json\").Path;\n        File.WriteAllText(tempPath, configJson.ToJsonString(new JsonSerializerOptions { WriteIndented = true }));\n\n        _customRuntimeConfigPath = tempPath;\n        return tempPath;\n    }\n\n    private void AddDashboardResource(DistributedApplicationModel model)\n    {\n        if (dashboardOptions.Value.DashboardPath is not { } dashboardPath)\n        {\n            throw new DistributedApplicationException(\"Dashboard path empty or file does not exist.\");\n        }\n\n        var fullyQualifiedDashboardPath = Path.GetFullPath(dashboardPath);\n        var dashboardWorkingDirectory = Path.GetDirectoryName(fullyQualifiedDashboardPath);\n\n        ExecutableResource dashboardResource;\n\n        if (BundleDiscovery.IsAspireManagedBinary(fullyQualifiedDashboardPath))\n        {\n            // aspire-managed is self-contained, run directly with \"dashboard\" subcommand\n            dashboardResource = new ExecutableResource(KnownResourceNames.AspireDashboard, fullyQualifiedDashboardPath, dashboardWorkingDirectory ?? \"\");\n\n            dashboardResource.Annotations.Add(new CommandLineArgsCallbackAnnotation(args =>\n            {\n                args.Insert(0, \"dashboard\");\n            }));\n        }\n        else","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting/Dashboard/DashboardEventHandlers.cs#L263-L299","documentation":"AddDashboardResource creates the dashboard executable resource from the configured DashboardPath. If the option is null/empty or doesn't point to an existing file (the message covers both cases as configured here), DistributedApplicationException is thrown because the app host cannot start the dashboard without it. This typically happens when the Aspire SDK-provided dashboard artifacts are missing.","triggerScenarios":"DashboardOptions.DashboardPath is not set (null); the configured dashboard executable file does not exist at the given path; using Aspire.Hosting without the SDK build target that normally locates the dashboard binary.","commonSituations":"Running the AppHost from an IDE or environment where the Aspire SDK targets didn't set DashboardPath; manually installed/updated SDK versions where the dashboard artifacts folder changed; moving the AppHost output so the relative dashboard path no longer resolves.","solutions":["Build via the Aspire SDK (dotnet build the AppHost) so DashboardPath is populated automatically; don't run the AppHost DLL directly with a plain dotnet SDK lacking Aspire targets","Set Aspire:Hosting:DashboardPath explicitly to an existing dashboard executable path","Verify the file exists at the configured path; reinstall/restore the Aspire SDK/dashboard artifacts if missing"],"exampleFix":"// before\n// no DashboardPath configured\n// after (appsettings or code)\nbuilder.Configuration[\"Aspire:Hosting:Dashboard:DashboardPath\"] = Path.Combine(AppContext.BaseDirectory, \"dashboard\", \"AspireDashboard.exe\");","handlingStrategy":"validation","validationCode":"var path = builder.Configuration[\"Aspire:Hosting:Dashboard:DashboardPath\"];\nif (string.IsNullOrEmpty(path) || !File.Exists(path))\n    throw new FileNotFoundException(\"Dashboard executable not found or DashboardPath not set.\", path);","typeGuard":null,"tryCatchPattern":"try { builder.Build().Run(); }\ncatch (DistributedApplicationException ex) when (ex.Message.Contains(\"Dashboard path\")) { /* fix Aspire SDK targets or set DashboardPath */ }","preventionTips":["Always build/run the AppHost through the Aspire SDK so DashboardPath is set automatically","Never run the AppHost assembly directly with a non-Aspire toolchain","After SDK upgrades, confirm the dashboard artifacts folder exists next to the AppHost output"],"tags":["dashboard","configuration","path"],"backgroundTag":"missing-config-value","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}