stride3d/stride · error · InvalidOperationException

Failed to install Stride

Error message

Failed to install Stride {target.Version}.

What it means

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.

Solutions

  1. Verify network access to the NuGet source (nuget.org or a configured mirror) and retry the install.
  2. Run `dotnet nuget locals all --clear` to purge a corrupted package cache, then retry.
  3. Check the NuGet source configuration (`dotnet nuget list source`) and add/fix the required source.
  4. Check any forwarded InstallProgress/restore log output for the underlying NuGet error (auth, 404, framework incompatibility) and fix that first.

Example fix

// before
stride install 8.1.2   // fails: restore blocked by proxy
// after (fix the source/proxy first)
stride config set nugetSource https://api.nuget.org/v3/index.json
stride install 8.1.2
Defensive patterns

Strategy: retry

Validate before calling

// before installing
var available = await versionManager.ListAvailable();
if (!available.Any(v => v.Version == requestedVersion)) throw new Exception($"Version {requestedVersion} not available from source");

Try / catch

try { var v = await versionManager.Install(versionSpec, progress); }
catch (InvalidOperationException ex) when (ex.Message.StartsWith("Failed to install")) {
    logger.LogWarning(ex, "Stride install failed; checking network/source before retry");
    // check nuget source connectivity, then retry with backoff
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/7b9f3d3613626dc9. Report an issue: GitHub.

Appendix: source

Thrown at sources/launcher/Stride.Cli/Core/StrideVersionManager.cs:70

    /// <summary>
    ///   Installs a Stride version and returns it. <paramref name="versionSpec"/> may be a full version,
    ///   a major.minor line (newest patch in that line), or null for the newest version. The newest/line
    ///   resolution prefers stable releases unless <paramref name="includePrerelease"/> is set; an explicit
    ///   version is always honored. Existing versions are left untouched.
    /// </summary>
    public async Task<StrideVersion> Install(string? versionSpec, bool includePrerelease, IProgress<InstallProgress>? progress, CancellationToken cancellationToken)
    {
        var available = (await store.FindSourcePackagesById(MainPackageId, cancellationToken))
            .OrderByDescending(package => package.Version)
            .ToList();

        var target = Resolve(available, versionSpec, includePrerelease)
            ?? throw new InvalidOperationException(string.IsNullOrEmpty(versionSpec)
                ? "No Stride version is available from the package source."
                : $"No Stride version matching '{versionSpec}' is available.");

        var installed = await InstallWithProgress(target, progress)
            ?? throw new InvalidOperationException($"Failed to install Stride {target.Version}.");

        return ToStrideVersion(installed);
    }

    // Installs a resolved package, forwarding NuGet's restore events as InstallProgress updates.
    private async Task<NugetLocalPackage?> InstallWithProgress(NugetServerPackage target, IProgress<InstallProgress>? progress)
    {
        if (progress is null)
            return await store.InstallPackage(target.Id, target.Version, target.TargetFrameworks, progress: null);

        var version = target.Version.ToString();
        var completed = 0;
        var total = 0;

        progress.Report(new InstallProgress(InstallStage.Downloading, version));

        void OnDownload(long downloaded)
            => progress.Report(new InstallProgress(InstallStage.Downloading, version, DownloadedBytes: downloaded));

View on GitHub (pinned to 96fad776d2)