stride3d/stride · error · InvalidOperationException
Error code while running install package process [ ]
Error message
Error code {exitCode} while running install package process [{packageInstall}]
What it means
After the spawned package installer process exits, NugetStore checks process.ExitCode and throws this InvalidOperationException when it is non-zero, appending the captured stderr/stdout output so the real installer failure is visible.
Solutions
- Read the appended errorOutput in the exception message — it contains the installer's actual diagnostics
- Rerun the install elevated / with correct permissions if the installer failed on access rights
- Verify package integrity (re-download) if output indicates corruption
- Close processes locking the target files (IDE, previous install) and retry
Example fix
// before
try { await store.Install(package); }
catch (InvalidOperationException) { /* no info */ }
// after
try { await store.Install(package); }
catch (InvalidOperationException ex)
{
Console.WriteLine($"Installer failed: {ex.Message}"); // includes exit code + output
// handle per installer diagnostics
} Defensive patterns
Strategy: try-catch
Try / catch
try { await store.Install(package); }
catch (InvalidOperationException ex) when (ex.Message.StartsWith("Error code"))
{
var diagnostics = ex.Message; // includes installer output
// surface diagnostics to the user, retry with elevation if access denied
} Prevention
- Always read the exception message for the captured installer output
- Close apps locking target directories before installing
- Run installers with sufficient privileges
When it happens
Trigger: The install-package helper process runs but exits with a non-zero code (ExitCode != 0) during the store's InstallPackage flow.
Common situations: Installer fails due to missing dependencies or privileges; package payload corrupted; target directory locked by another process; installer itself reports a package-specific error in its output.
Related errors
- Could not start install package process
- Metadata loaded from nuspec cannot have more than one group…
- Could not restore package
- Could not find installation path for package
- Could not locate native library
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/ba453c1b7d856392.
Report an issue: GitHub.
Appendix: source
Thrown at sources/assets/Stride.Core.Packages/NugetStore.cs:1099
{
// Save errors
lock (process)
{
errorOutput.AppendLine(args.Data);
}
}
};
// Process output and wait for exit
process.BeginOutputReadLine();
process.BeginErrorReadLine();
process.WaitForExit();
// Check exit code
var exitCode = process.ExitCode;
if (exitCode != 0)
{
throw new InvalidOperationException($"Error code {exitCode} while running install package process [{packageInstall}]\n\n" + errorOutput);
}
}
// Used only for Stride 1.x and 2.x
private void UpdateTargetsHelper()
{
if (oldRootDirectory == null)
return;
// Get latest package only for each MainPackageIds (up to 2.x)
var strideOldPackages = GetLocalPackages("Xenko").Where(package => package.Tags?.Contains("internal") != true).Where(x => x.Version.Version.Major < 3).ToList();
// Generate target file
var targetGenerator = new TargetGenerator(this, strideOldPackages, "SiliconStudioPackage");
var targetFileContent = targetGenerator.TransformText();
var targetFile = Path.Combine(oldRootDirectory, @"Targets\SiliconStudio.Common.targets");
var targetFilePath = Path.GetDirectoryName(targetFile);View on GitHub (pinned to 96fad776d2)