{"record":{"id":"ba6c9d91ad891ab5","repo":"microsoft/aspire","slug":"new-cli-executable-failed-verification-test","errorCode":null,"errorMessage":"New CLI executable failed verification test.","messagePattern":"New CLI executable failed verification test\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Commands/UpdateCommand.cs","lineNumber":828,"sourceCode":"\n            try\n            {\n                // Copy new executable to install location\n                InteractionService.DisplayMessage(KnownEmojis.Wrench, $\"Installing new CLI to {installDir}...\");\n                File.Copy(newExePath, targetExePath, overwrite: true);\n\n                // On Unix systems, ensure the executable bit is set\n                if (!_environment.IsWindows())\n                {\n                    SetExecutablePermission(targetExePath);\n                }\n\n                // Test the new executable and display its version\n                _logger.LogDebug(\"Testing new CLI executable and displaying version\");\n                var newVersion = await GetNewVersionAsync(targetExePath, cancellationToken);\n                if (newVersion is null)\n                {\n                    throw new InvalidOperationException(\"New CLI executable failed verification test.\");\n                }\n\n                // The new binary will extract its embedded bundle on first run via EnsureExtractedAsync.\n                // No proactive extraction needed — the payload is inside the new binary's embedded resources,\n                // which are only accessible when that binary is running.\n\n                // Display helpful message about PATH\n                if (!IsInPath(installDir, _environment))\n                {\n                    InteractionService.DisplayMessage(KnownEmojis.Information, $\"Note: {installDir} is not in your PATH. Add it to use the updated CLI globally.\");\n                }\n\n                // Shared staging archives can contain a ship-candidate binary deliberately stamped\n                // as stable. Persist the channel selected by this update so the next invocation keeps\n                // using staging instead of falling back to the binary stamp. Remove any sidecar version\n                // and commit assigned to the previous executable so identity falls back to the replacement\n                // binary's metadata. Commit while the executable backup still exists so a sidecar\n                // failure restores the previous CLI.","sourceCodeStart":810,"sourceCodeEnd":846,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Commands/UpdateCommand.cs#L810-L846","documentation":"After replacing the running executable, the self-update runs the new binary to read its version as a smoke test. If the new binary does not report a version (crash, missing dependencies, truncated file), the update is considered failed and an InvalidOperationException is thrown.","triggerScenarios":"`aspire update --self` where the freshly replaced `aspire` binary cannot execute and print its version — e.g. corrupted extraction, incompatible binary for the platform, missing runtime prerequisites, or the file being quarantined by antivirus.","commonSituations":"AV/EDR quarantining newly written executables, partially written binaries on flaky filesystems, network-mounted install directories with exec restrictions, or cross-architecture archives.","solutions":["Run the new `aspire --version` manually to see the underlying failure","Re-run `aspire update --self` (or reinstall via the installer script) to rewrite the binary","Check antivirus/quarantine logs and whitelist the install directory","Ensure the install directory is on a filesystem that allows executing newly written files (no noexec mounts)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"var probe = Process.Start(new ProcessStartInfo(targetExe, \"--version\") { RedirectStandardOutput = true });\nprobe.WaitForExit(10000);\nif (probe.ExitCode != 0) Console.Error.WriteLine(\"New binary failed smoke test before update.\");","typeGuard":null,"tryCatchPattern":"try { await UpdateSelfAsync(); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"failed verification test\"))\n{ Console.Error.WriteLine(\"Run 'aspire --version' to see the real failure; reinstall if needed.\"); }","preventionTips":["Whitelist the install directory in AV/EDR software","Keep the CLI on a local, executable filesystem (not noexec mounts)","Update only to channels compatible with your OS/architecture"],"tags":["cli","self-update","verification"],"backgroundTag":"internal-invariant-violation","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"}