stride3d/stride · error · ArgumentException

Package file [ ] doesn't exist

Error message

Package file [{0}] doesn't exist

What it means

ValidateOptions throws this ArgumentException when PackageFile was explicitly supplied (non-whitespace) but File.Exists(PackageFile) is false. Unlike error 12 (no input at all), an input was given but points at a missing .sdpkg file. The formatted message includes the exact path checked.

Solutions

  1. Confirm the .sdpkg file exists at the given path and fix the path if not
  2. Use an absolute path to avoid CWD surprises
  3. If the package should be produced by an earlier step, run/verify that step first
  4. Check filename casing on case-sensitive filesystems

Example fix

// before
--input-package-file=MyGame/MyGame.spkg
// after
--input-package-file=MyGame/MyGame.sdpkg
Defensive patterns

Strategy: validation

Validate before calling

if (!string.IsNullOrWhiteSpace(packageFile) && !File.Exists(packageFile))
    throw new FileNotFoundException($"Package file not found: {packageFile}", packageFile);

Try / catch

try { RunBuilder(options); } catch (ArgumentException ex) when (ex.ParamName == "inputPackageFile") { Console.Error.WriteLine($"Package file missing: {options.PackageFile}"); return 1; }

Prevention

When it happens

Trigger: Invoking with --input-package-file (PackageFile) set to a path where no package file exists: wrong filename/extension, file not yet built, relative path resolved against an unexpected CWD, or moved/deleted package.

Common situations: Pointing at the project's source package before it was ever compiled; typos in package names in build scripts; Linux case-sensitive paths vs Windows-built scripts; artifacts cleaned by a previous CI step.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at sources/assets/Stride.AssetCompiler/PackageBuilderOptions.cs:108

            }

            if (SlavePipe == null)
            {
                if (!string.IsNullOrWhiteSpace(PackageManifestFile))
                {
                    if (!File.Exists(PackageManifestFile))
                        throw new ArgumentException("Build manifest [{0}] doesn't exist".ToFormat(PackageManifestFile), "packageManifestFile");
                }
                else if (string.IsNullOrWhiteSpace(PackageFile))
                {
                    if (string.IsNullOrWhiteSpace(SolutionFile) || PackageId == Guid.Empty)
                    {
                        throw new ArgumentException("This tool requires an input file (package, project, or .sdbuild manifest), or a --solution-file and --package-id.", "inputPackageFile");
                    }
                }
                else if (!File.Exists(PackageFile))
                {
                    throw new ArgumentException("Package file [{0}] doesn't exist".ToFormat(PackageFile), "inputPackageFile");
                }
            }
        }
    }
}

View on GitHub (pinned to 96fad776d2)