stride3d/stride · error · InvalidOperationException

Missing external reference metadata for

Error message

Missing external reference metadata for {_request.Project.Name}

What it means

GetProjectReferences threw this when external references were provided as input, but the top-level project could not be located in the computed project closure, so no external-reference metadata can be attached. The source comment states this is always an internal issue, typically caused by errors building the project closure.

Solutions

  1. File a bug / investigate the earlier project-closure build errors in the logs
  2. Fix or reload the solution and retry the reference resolution
  3. Ensure the project builds cleanly (msbuild/dotnet build) before requesting references
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the project closure built cleanly before requesting external references
if (!closureBuildSucceeded) throw new InvalidOperationException("Project closure failed to build; references unavailable");

Try / catch

try { GetProjectReferences(request); }
catch (InvalidOperationException ex) when (ex.Message.StartsWith("Missing external reference metadata"))
{ logger.Error(ex, "Internal closure failure — check earlier MSBuild errors"); }

Prevention

When it happens

Trigger: Calling the reference-resolution request for a project while the MSBuild/project closure was built with errors, so the top-level project record is missing from the internal list even though external references were supplied.

Common situations: MSBuild workload registration failures, corrupted solution/project files, previous build errors during closure construction, engine/editor internal bugs.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at sources/assets/Stride.Core.Assets/PackageSession.Dependencies.cs:649

                updatedExternalProjects.AddRange(_request.ExternalProjects
                    .Where(project =>
                        !project.UniqueName.Equals(rootProject.UniqueName, StringComparison.Ordinal)));

                var updatedReference = new ExternalProjectReference(
                    rootProject.UniqueName,
                    _request.Project,
                    rootProject.MSBuildProjectPath,
                    rootProject.ExternalProjectReferences);

                updatedExternalProjects.Add(updatedReference);
            }
        }
        else
        {
            // External references were passed, but the top level project wasn't found.
            // This is always due to an internal issue and typically caused by errors
            // building the project closure.
            throw new InvalidOperationException($"Missing external reference metadata for {_request.Project.Name}");
        }

        return updatedExternalProjects;
    }
}

View on GitHub (pinned to 96fad776d2)