{"record":{"id":"8d5513a96678f78f","repo":"Unity-Technologies/UnityCsReference","slug":"could-not-locate-assembly-for-name","errorCode":null,"errorMessage":"Could not locate assembly for {name}","messagePattern":"Could not locate assembly for (.+?)","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs","lineNumber":654,"sourceCode":"                var topLevel = il2CppFolder;\n                if (customRoot != null)\n                    topLevel = Path.Combine(topLevel, customRoot);\n\n                var toolBinDirectory = Path.Combine(topLevel, name, \"bin\").ToNPath();\n#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.\n                var candidates = toolBinDirectory.Files($\"*{expectedToolExecutableName}\", recurse: true)\n#pragma warning restore UA2001\n                    .Where(f => f.Parent.FileName == tfm)\n                    .OrderByDescending(f => f.GetLastWriteTimeUtc())\n                    .ToArray();\n\n                if (candidates.Length == 0)\n                    throw new InvalidOperationException($\"{name} does not appear to be built in {il2CppFolder}\");\n\n                return candidates[0].Parent.ToString();\n            }\n\n            throw new ArgumentException($\"Could not locate assembly for {name}\");\n        }\n\n        internal static string ConstructBeeLibrarySearchPath()\n        {\n            var projectBinDirs = new[]\n            {\n                GetLibrarySearchPaths(\"Unity.Options\", \"netstandard2.0\", \"external/UnityOptions\"),\n                GetLibrarySearchPaths(\"Unity.Linker.Api\", \"netstandard2.0\"),\n                GetLibrarySearchPaths(\"Unity.IL2CPP.Api\", \"netstandard2.0\"),\n                GetLibrarySearchPaths(\"Unity.Api.Attributes\", \"netstandard2.0\"),\n                GetLibrarySearchPaths(\"Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.Data\", \"netstandard2.0\"),\n                GetLibrarySearchPaths(\"Unity.IL2CPP.Bee.BuildLogic\", \"net10.0\"),\n                // Now the quirky part.  We need to locate the platform build logic assemblies.\n                // While il2cpp will have these during some build scenarios (IDE build or build.pl)\n                // the project that will always have all of the is il2cpp-compile\n                GetExePath(\"il2cpp-compile\").ToNPath().Parent\n            };\n","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs#L636-L672","documentation":"The terminal fallthrough of GetLibrarySearchPaths: reached only when the function is neither in a development location nor in the deploy location that holds the assembly. It throws ArgumentException because no branch could locate the assembly for the given name.","triggerScenarios":"GetLibrarySearchPaths is called when isDevelopmentLocation is false AND the deploy branch does not contain the named assembly, OR the dev branch was skipped and no deploy path resolves. Functionally an unreachable-lookup state where the IL2CPP folder layout is unrecognized.","commonSituations":"Corrupt or partial editor install where the deploy folder lacks one of the required support DLLs; custom IL2CPP folder override pointing at a directory with neither dev nor deploy layout.","solutions":["Verify the IL2CPP deploy folder is intact and contains all required support assemblies (reinstall/repair the editor if missing).","Check any custom IL2CPP folder override points to a valid deploy root.","Ensure isDevelopmentLocation detection is correct for your setup; build the dev enlistment if you intend dev mode."],"exampleFix":"/* no source edit */\n// before: custom IL2CPP root missing Unity.Api.Attributes.dll\n// after: restore the editor install or copy the deploy/lib contents\n// so <deployRoot>/lib/netstandard2.0/Unity.Api.Attributes.dll exists","handlingStrategy":"validation","validationCode":"if (!isDevelopmentLocation && !File.Exists(Path.Combine(GetDeployRoot(), \"lib\", tfm, name + \".dll\")))\n    throw new InvalidOperationException($\"{name} assembly missing from deploy location; repair the editor install.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Repair/reinstall the editor if the deploy IL2CPP folder is missing assemblies.","Validate custom IL2CPP folder overrides resolve to a complete deploy root."],"tags":["il2cpp","library-search-path","install-corruption","deploy"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}