{"record":{"id":"7b9f3d3613626dc9","repo":"stride3d/stride","slug":"failed-to-install-stride-target-version","errorCode":null,"errorMessage":"Failed to install Stride {target.Version}.","messagePattern":"Failed to install Stride (.+?)\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/launcher/Stride.Cli/Core/StrideVersionManager.cs","lineNumber":70,"sourceCode":"    /// <summary>\n    ///   Installs a Stride version and returns it. <paramref name=\"versionSpec\"/> may be a full version,\n    ///   a major.minor line (newest patch in that line), or null for the newest version. The newest/line\n    ///   resolution prefers stable releases unless <paramref name=\"includePrerelease\"/> is set; an explicit\n    ///   version is always honored. Existing versions are left untouched.\n    /// </summary>\n    public async Task<StrideVersion> Install(string? versionSpec, bool includePrerelease, IProgress<InstallProgress>? progress, CancellationToken cancellationToken)\n    {\n        var available = (await store.FindSourcePackagesById(MainPackageId, cancellationToken))\n            .OrderByDescending(package => package.Version)\n            .ToList();\n\n        var target = Resolve(available, versionSpec, includePrerelease)\n            ?? throw new InvalidOperationException(string.IsNullOrEmpty(versionSpec)\n                ? \"No Stride version is available from the package source.\"\n                : $\"No Stride version matching '{versionSpec}' is available.\");\n\n        var installed = await InstallWithProgress(target, progress)\n            ?? throw new InvalidOperationException($\"Failed to install Stride {target.Version}.\");\n\n        return ToStrideVersion(installed);\n    }\n\n    // Installs a resolved package, forwarding NuGet's restore events as InstallProgress updates.\n    private async Task<NugetLocalPackage?> InstallWithProgress(NugetServerPackage target, IProgress<InstallProgress>? progress)\n    {\n        if (progress is null)\n            return await store.InstallPackage(target.Id, target.Version, target.TargetFrameworks, progress: null);\n\n        var version = target.Version.ToString();\n        var completed = 0;\n        var total = 0;\n\n        progress.Report(new InstallProgress(InstallStage.Downloading, version));\n\n        void OnDownload(long downloaded)\n            => progress.Report(new InstallProgress(InstallStage.Downloading, version, DownloadedBytes: downloaded));","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/launcher/Stride.Cli/Core/StrideVersionManager.cs#L52-L88","documentation":"StrideVersionManager.Install resolves a NuGet package for the requested Stride version, then installs it via InstallWithProgress. When NuGet's restore/install returns no local package (null), the manager surfaces this error. It means the package was resolved but the actual download/install produced no result.","triggerScenarios":"Running a Stride CLI install command where InstallWithProgress returns null: package download failure, NuGet source unreachable or misconfigured, restore errors, or an incompatible package for the current framework.","commonSituations":"Corporate proxy/firewall blocking nuget.org; a version whose dependencies fail to restore; disk or cache issues in the NuGet cache; offline machines attempting an install.","solutions":["Verify network access to the NuGet source (nuget.org or a configured mirror) and retry the install.","Run `dotnet nuget locals all --clear` to purge a corrupted package cache, then retry.","Check the NuGet source configuration (`dotnet nuget list source`) and add/fix the required source.","Check any forwarded InstallProgress/restore log output for the underlying NuGet error (auth, 404, framework incompatibility) and fix that first."],"exampleFix":"// before\nstride install 8.1.2   // fails: restore blocked by proxy\n// after (fix the source/proxy first)\nstride config set nugetSource https://api.nuget.org/v3/index.json\nstride install 8.1.2","handlingStrategy":"retry","validationCode":"// before installing\nvar available = await versionManager.ListAvailable();\nif (!available.Any(v => v.Version == requestedVersion)) throw new Exception($\"Version {requestedVersion} not available from source\");","typeGuard":null,"tryCatchPattern":"try { var v = await versionManager.Install(versionSpec, progress); }\ncatch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Failed to install\")) {\n    logger.LogWarning(ex, \"Stride install failed; checking network/source before retry\");\n    // check nuget source connectivity, then retry with backoff\n}","preventionTips":["Verify NuGet source connectivity before scripted installs.","Clear the NuGet cache after failed installs to avoid corrupted-package repeats.","Capture and inspect InstallProgress restore events to catch the underlying NuGet failure early.","Pin explicit versions and validate them against the available list first."],"tags":["nuget","install","network"],"backgroundTag":"http-request-failed","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}