Unity导入旧脚本后出现Failed to find entry-points错误求助
错误分析与排查思路
错误信息
Failed to find entry-points: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00105] in <ebb9e4250ed24cbfa42055e3532ef311>:0 at zzzUnity.Burst.CodeGen.AssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00039] in <a2dd15248a25411e914af2a2c82fb63f>:0 at Burst.Compiler.IL.AssemblyLoader.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00079] in <a2dd15248a25411e914af2a2c82fb63f>:0 at Burst.Compiler.IL.Server.EntryPointMethodFinder.FindEntryPoints (System.String[] rootAssemblyNames, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, Burst.Compiler.IL.Server.ProfileDelegate profileCallback, System.Boolean includeRootAssemblyReferences, System.Boolean splitTargets, Burst.Compiler.IL.Helpers.DebugLogWriter debugWriter) [0x00055] in <a2dd15248a25411e914af2a2c82fb63f>:0 at Burst.Compiler.IL.Server.FindMethodsJob.Execute (Burst.Compiler.IL.Server.CompilerServerJobExecutionContext context) [0x00133] in <a2dd15248a25411e914af2a2c82fb63f>:0 While compiling job:
核心定位
这个错误本质是Burst编译器扫描Job入口点时,无法找到或加载Assembly-CSharp(自定义脚本编译后的程序集),并非.NET SDK损坏。
排查步骤
- 检查脚本基础编译状态:先查看Unity控制台是否有其他编译错误(比如语法错误、缺失引用),如果
Assembly-CSharp本身编译失败,Burst自然无法找到它。执行Assets > Reimport All重新导入所有资源,等待脚本完全编译完成后重试。 - 验证Burst版本兼容性:Unity 2021.3.21f1是LTS版本,最新版Burst可能存在兼容问题。建议回退到Unity官方推荐的Burst版本(在Package Manager中查看Burst的兼容标签,或查阅Unity 2021.3官方文档),比如Burst 1.8.x或2.2.x系列版本。
- 排查Job代码的Burst兼容性:导入的脚本中若有标记
[BurstCompile]的Job,可能存在不符合Burst要求的代码:- 使用了Burst不支持的.NET API(如反射调用、非值类型的跨程序集引用)
- Job结构体未正确实现
IJob/IJobParallelFor等接口,或Execute()方法存在语法/逻辑问题 - 逐个移除导入的脚本,定位触发错误的具体文件,缩小排查范围
- 清理Burst缓存:Burst编译缓存损坏可能导致加载异常:
- 关闭Unity
- 删除项目目录下的
Library/BurstCache文件夹 - 重启Unity并重新编译
- 检查自定义程序集设置:如果脚本放在自定义程序集(Assembly Definition)中,确保该程序集正确引用
Assembly-CSharp,且开启了Burst编译支持。同时确认Burst能扫描到自定义程序集的Job入口点。 - 核对项目.NET版本:检查
Edit > Project Settings > Player > Other Settings > Configuration > Scripting Runtime Version,确保与之前项目的.NET版本一致(Unity 2021.3默认用.NET Framework 4.x),避免版本不匹配导致程序集加载失败。
内容的提问来源于stack exchange,提问作者Ayush Choudhary
相关产品推荐
相关产品推荐

