{"record":{"id":"32584d0438f999dd","repo":"microsoft/aspire","slug":"extracted-cli-executable-not-found-newexepath","errorCode":null,"errorMessage":"Extracted CLI executable not found: {newExePath}","messagePattern":"Extracted CLI executable not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Commands/UpdateCommand.cs","lineNumber":786,"sourceCode":"        try\n        {\n            // Extract archive\n            await InteractionService.ShowStatusAsync(\n                UpdateCommandStrings.ExtractingNewCli,\n                async () =>\n                {\n                    await ArchiveHelper.ExtractAsync(archivePath, tempExtractDir, _environment, cancellationToken);\n                    return 0;\n                },\n                KnownEmojis.Package);\n\n            InteractionService.DisplayMessage(KnownEmojis.Package, UpdateCommandStrings.ExtractedNewCli);\n\n            // Find the aspire executable in the extracted files\n            var newExePath = Path.Combine(tempExtractDir, exeName);\n            if (!File.Exists(newExePath))\n            {\n                throw new FileNotFoundException($\"Extracted CLI executable not found: {newExePath}\");\n            }\n\n            // Prepare the sidecar before replacing the running single-file executable. JSON\n            // serialization can load framework assemblies lazily, and after replacement the\n            // bundle loader could resolve those assemblies from the new executable instead of\n            // the bundle used by this process.\n            using var sidecarUpdate = InstallSidecarWriter.PrepareForSelfUpdate(installDir, channel);\n\n            // Backup current executable if it exists\n            var exeDir = Path.GetDirectoryName(targetExePath)!;\n            FileDeleteHelper.TryCleanupOldItems(exeDir, exeName);\n\n            string? backupPath = null;\n            if (File.Exists(targetExePath))\n            {\n                InteractionService.DisplayMessage(KnownEmojis.FloppyDisk, \"Backing up current CLI...\");\n\n                // Rename current executable to .old.[timestamp]","sourceCodeStart":768,"sourceCodeEnd":804,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Commands/UpdateCommand.cs#L768-L804","documentation":"After downloading and extracting the update archive to a temp directory, the self-update verifies that the expected `aspire` (or `aspire.exe`) executable exists at the expected location inside the extracted payload. If the file is missing, the archive contents differ from expectations and a FileNotFoundException is thrown naming the expected path.","triggerScenarios":"`aspire update --self` where the downloaded archive does not contain the platform executable at its root — e.g. a corrupted/truncated download, a channel serving an archive layout for a different platform/OS, or a mismatch between the detected OS and the archive fetched.","commonSituations":"Proxy or mirror serving a stale/partial archive, architecture mismatch (e.g. arm64 CLI fetching an x64 archive), or interrupted downloads cached by an HTTP layer.","solutions":["Retry `aspire update --self` to re-download a fresh archive","Clear any package/download cache used by the CLI and retry","Verify you are on a supported OS/architecture and that the selected channel publishes archives for it","Fall back to the platform installer script to update instead of the in-place self-update"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (!await IsArchiveReachableAsync(archiveUrl))\n    Console.Error.WriteLine(\"Update archive unreachable; check network/channel before self-update.\");","typeGuard":null,"tryCatchPattern":"try { await UpdateSelfAsync(); }\ncatch (FileNotFoundException ex) when (ex.Message.Contains(\"Extracted CLI executable not found\"))\n{ Console.Error.WriteLine(\"Archive was incomplete or for the wrong platform; retry or use the installer.\"); }","preventionTips":["Ensure stable network access or retry on transient download failures","Confirm OS/architecture matches the channel's published archives","Avoid mirrors/proxies that may serve stale partial archives"],"tags":["cli","self-update","download"],"backgroundTag":"file-not-found","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"}