Unity-Technologies/UnityCsReference · error · ArgumentException

Unable to find entry for {outputfileForwardSlash} in dataFro

Error message

Unable to find entry for {outputfileForwardSlash} in dataFromBuildProgram

What it means

ArgumentException from FindOutputDataAssemblyInfoFor: after a Bee build node finishes, its output file could not be matched to any assembly entry in ScriptCompilationData_Out.Assemblies. The build program's reported output set and the expected assembly list disagree.

Source

Thrown at Editor/Mono/Scripting/ScriptCompilation/BeeDriver/UnityScriptUpdater.cs:239

            return new Update()
            {
                tempFileWithNewContents = line[..indexOfSeparator],
                originalFileWithError = line[(indexOfSeparator + separator.Length)..]
            };
        }
    }

    static class Helpers
    {
        public static AssemblyData_Out FindOutputDataAssemblyInfoFor(NodeFinishedMessage nodeResult, ObjectsFromDisk dataFromBuildProgram)
        {
            var scriptCompilationDataOut = dataFromBuildProgram.Get<ScriptCompilationData_Out>();
            var outputfileForwardSlash = new NPath(nodeResult.Node.OutputFile).ToString();
#pragma warning disable UA2001 // The Banned API Analyzer produces compile errors for any new Linq code. This pre-existing usage has been suppressed, but should be rewritten if possible.
            var assemblyDataOut = scriptCompilationDataOut.Assemblies.FirstOrDefault(a => a.Path == outputfileForwardSlash);
#pragma warning restore UA2001
            return assemblyDataOut ?? throw new ArgumentException($"Unable to find entry for {outputfileForwardSlash} in dataFromBuildProgram");
        }

        public static bool LocalizeCompilerMessages(ObjectsFromDisk dataFromBuildProgram)
        {
            var scriptCompilationDataOut = dataFromBuildProgram.Get<ScriptCompilationData_Out>();
            return scriptCompilationDataOut.LocalizeCompilerMessages;
        }
    }
}

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Clean Library/ and the Bee build artifacts, then rebuild.
  2. Ensure the build program version matches the editor (no partial upgrade).
  3. If using a custom pipeline, verify output file paths line up with the declared assembly paths.
Defensive patterns

Strategy: try-catch

Validate before calling

var match = scriptCompilationDataOut.Assemblies.FirstOrDefault(a => a.Path == outputfileForwardSlash);
if (match == null)
    throw new InvalidOperationException($"No assembly entry for {outputfileForwardSlash}; build program output may be stale.");

Try / catch

try
{
    var info = Helpers.FindOutputDataAssemblyInfoFor(nodeResult, dataFromBuildProgram);
}
catch (ArgumentException ex) when (ex.Message.Contains("Unable to find entry"))
{
    // Clean Bee/Library build artifacts and rebuild to re-sync the output set.
}

Prevention

When it happens

Trigger: Processing a NodeFinishedMessage whose Node.OutputFile does not match any ScriptCompilationData_Out.Assemblies[i].Path (compared as forward-slash NPath strings).

Common situations: Bee build program out of sync with the editor driver, stale Library/ state, a custom build pipeline producing unexpected output paths, or path-separator mismatches between the build program and the consumer.

Related errors


AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13). Data as JSON: /api/errors/0b02a73ee12de3d5. Report an issue: GitHub.