简体   繁体   English

未处理的异常:Unity3d中的System.Reflection.ReflectionTypeLoadException

[英]Unhandled Exception: System.Reflection.ReflectionTypeLoadException in Unity3d

I'm getting this error: compile time error when running i have searched on unity forum they are saying its for the System.Web.dll file issue, i have cleared that, also reimported assets but its still not working. 我收到此错误:运行时编译时错误我在团结论坛上搜索了他们说它的System.Web.dll文件问题,我已经清除了,也重新导入资产但它仍然无法正常工作。

Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

the answers i got from unity are : 我从团结中得到的答案是:

and none of them helped me. 他们都没有帮助我。

The problem is caused by the Unity.PackageManager.dll in your project. 问题是由项目中的Unity.PackageManager.dll引起的。 Delete that and it will be gone. 删除它,它将消失。

You've also got a folder under Editor that contains a bunch of editor scripts for Standard Assets, but you don't have Standard Assets Installed, so you're going to get a bunch of compiler errors from that. 您还在Editor下有一个文件夹,其中包含一系列标准资产的编辑器脚本,但您没有安装标准资产,因此您将从中获得一堆编译器错误。 Delete the Editor folder or install Standard Assets and it will work. 删除编辑器文件夹或安装标准资产,它将工作。

I'm not sure where you got the tutorial files, but nothing in this project seems to work correctly. 我不确定你在哪里获得教程文件,但是这个项目中的任何内容似乎都无法正常工作。 All the scenes are empty. 所有场景都是空的。 I would advise you go find a different tutorial. 我建议你去找一个不同的教程。

Problems like this could be related to "Target Framework" setting in the DLL's compilation options. 这样的问题可能与DLL的编译选项中的“目标框架”设置有关。 Which should be considered for already compiled system DLL's too. 对于已编译的系统DLL也应该考虑哪个。

So in your case, I think you might be using the wrong DLL version. 所以在你的情况下,我认为你可能使用了错误的DLL版本。 If you need to import extra system DLL's, make sure you get them from Unity installation folder: 如果您需要导入额外的系统DLL,请确保从Unity安装文件夹中获取它们:

C:\\Program Files\\Unity\\Editor\\Data\\Mono\\lib\\mono\\2.0 C:\\ Program Files \\ Unity \\ Editor \\ Data \\ Mono \\ lib \\ mono \\ 2.0

Beware that there might be multiple DLL's with the same name in other subfolders like MonoBleedingEdge. 请注意,在其他子文件夹(如MonoBleedingEdge)中可能存在多个具有相同名称的DLL。 Make sure you use the folder above. 确保使用上面的文件夹。

In case you build a DLL on your own, "Target Framework" setting should be set to a proper one. 如果您自己构建DLL,“Target Framework”设置应设置为正确的。 You may figure out the correct setting by trying. 您可以通过尝试找出正确的设置。

I was getting this error when referencing a dll I had compiled with platform target set to Any CPU . 在引用我编译的平台目标设置为任何CPU的DLL时,我收到此错误。 Fixed by changing it to x86 . 通过将其更改为x86来修复。

I fixed this error, when change Target framework to .Net Framework 3.5 , and set the Copy Local to false of UnityEngine's references. 我修改了这个错误,将Target框架更改为.Net Framework 3.5 ,并将Copy Local设置为UnityEngine引用的false

And after dragging the dll, the error is gone. 拖动dll后,错误消失了。

Hope this will help. 希望这会有所帮助。

Wow I got a version of this Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. 哇,我得到了这个Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.一个版本Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. nonsense ... after couple hours of crying/raging, reimporting assets, deleting Library/Temp folders, changing platforms, reimporting plugins i finally got past it. 废话......经过几个小时的哭泣/肆虐,重新导入资产,删除Library / Temp文件夹,更改平台,重新导入插件,我终于通过了它。 Honestly I don't know exactly what fixed it .. ugh that was annoying. 老实说,我不知道究竟是什么修好了......呃这很烦人。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 添加显示未处理的异常的Emgu.CV.World dll时:System.Reflection.ReflectionTypeLoadException - On Adding Emgu.CV.World dll showing Unhandled Exception: System.Reflection.ReflectionTypeLoadException SpecFlow FeatureSetup引发System.Reflection.ReflectionTypeLoadException - SpecFlow FeatureSetup throws System.Reflection.ReflectionTypeLoadException 获取程序集中的类型(错误:System.Reflection.ReflectionTypeLoadException) - Get Types in assembly (error: System.Reflection.ReflectionTypeLoadException) coiniumServ在Windows上运行,在单声道运行时出现System.Reflection.ReflectionTypeLoadException失败。 - coiniumServ works on windows, fails on mono at runtime with System.Reflection.ReflectionTypeLoadException Unity3D未处理的异常未记录 - Unity3D unhandled exception not logging Windows服务:抛出System.Reflection.ReflectionTypeLoadException并显示以下错误消息:无法加载一个或多个re - Windows Service: System.Reflection.ReflectionTypeLoadException was thrown with the following error message: Unable to load one or more of the re 使用Sybase时AppDomain.CurrentDomain.GetAssemblies()引发System.Reflection.ReflectionTypeLoadException - AppDomain.CurrentDomain.GetAssemblies() throws System.Reflection.ReflectionTypeLoadException when using Sybase C# - 动态加载 DLL - System.Reflection.ReflectionTypeLoadException:无法加载一种或多种请求的类型 - C# - Loading DLL Dynamic - System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types System.Reflection.ReflectionTypeLoadException: '无法加载一种或多种请求的类型。 无法加载文件或程序集 - System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types. Could not load file or assembly Unity 3d未处理的异常:System.UnauthorizedAccessException - Unity 3d Unhandled Exception: System.UnauthorizedAccessException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM