stride3d/stride · error · ArgumentException

Build manifest [ ] must exist

Error message

Build manifest [{rootManifestFile}] must exist

What it means

PackageSessionHelper.LoadFromBuildManifest loads a session from a previously saved build manifest file. It throws ArgumentException when the supplied rootManifestFile path does not exist on disk, failing fast before attempting to parse a missing file.

Solutions

  1. Check File.Exists(rootManifestFile) before calling and produce a friendly message
  2. Run the build/packaging step that generates the manifest first
  3. Pass an absolute path (the code calls FileUtility.GetAbsolutePath, but verify base directory)
  4. Verify the relative path resolves from the expected working directory

Example fix

// before
PackageSessionHelper.LoadFromBuildManifest("build/manifest.xml", sessionResult);
// after
var manifest = Path.GetFullPath("build/manifest.xml");
if (!File.Exists(manifest)) throw new FileNotFoundException("Run a build first to generate the manifest", manifest);
PackageSessionHelper.LoadFromBuildManifest(manifest, sessionResult);
Defensive patterns

Strategy: validation

Validate before calling

var abs = FileUtility.GetAbsolutePath(rootManifestFile);
if (!File.Exists(abs)) throw new FileNotFoundException($"Build manifest missing (run a build first): {abs}", abs);

Try / catch

try { PackageSessionHelper.LoadFromBuildManifest(manifest, sessionResult); }
catch (ArgumentException ex) { logger.Error(ex, "Build manifest missing or invalid"); }

Prevention

When it happens

Trigger: Calling LoadFromBuildManifest(rootManifestFile, sessionResult, loadParameters) with a path where no build manifest file exists (File.Exists returns false).

Common situations: Manifest not yet generated (build never ran), typo in the manifest path, manifest deleted by a clean, running from a different working directory with a relative path resolving elsewhere.

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/23e78b342baba72f. Report an issue: GitHub.

Appendix: source

Thrown at sources/assets/Stride.Core.Assets/PackageSession.BuildManifest.cs:33

using Stride.Core.Yaml;

namespace Stride.Core.Assets;

partial class PackageSession
{
    /// <summary>
    /// Loads a session from a build manifest (.sdbuild) chain. Each manifest contributes its authored
    /// package (folders/metadata), the exact assemblies to load
    /// (<see cref="AssetBuildManifest.AssetAssemblies"/>) and its project assets.
    /// </summary>
    public static void LoadFromBuildManifest(string rootManifestFile, PackageSessionResult sessionResult, PackageLoadParameters? loadParameters = null)
    {
        ArgumentNullException.ThrowIfNull(rootManifestFile);
        ArgumentNullException.ThrowIfNull(sessionResult);

        loadParameters ??= PackageLoadParameters.Default();
        rootManifestFile = FileUtility.GetAbsolutePath(rootManifestFile);
        if (!File.Exists(rootManifestFile)) throw new ArgumentException($"Build manifest [{rootManifestFile}] must exist", nameof(rootManifestFile));

        try
        {
            AssetReferenceAnalysis.EnableCaching = true;
            sessionResult.Clear();
            sessionResult.Progress("Loading..", 0, 1);

            var session = new PackageSession();

            // Chase the manifest chain (referenced project manifests), keyed by absolute path
            var manifests = new Dictionary<string, AssetBuildManifest>(StringComparer.OrdinalIgnoreCase);
            var queue = new Queue<string>();
            queue.Enqueue(rootManifestFile);
            while (queue.Count > 0)
            {
                var file = queue.Dequeue();
                if (manifests.ContainsKey(file))
                    continue;

View on GitHub (pinned to 96fad776d2)