Unity内部编译器错误与自定义dll [英] Unity internal compiler error with custom dll

查看:1366
本文介绍了Unity内部编译器错误与自定义dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了几个小时尝试解决方案,我在网上发现,但没有什么工作,所以这里是我的问题Stackoverflowers。



我做了一个小插件的Unity和导入dll到我的项目文件夹。它工作正常,当我在编辑器中启动游戏,但如果我尝试编译我得到以下:

 内部编译器错误。有关详细信息,请参阅控制台日志。输出为:
未处理的异常:System.Reflection.ReflectionTypeLoadException:无法加载模块中的类。

at(wrapper managed-to-native)System.Reflection.Assembly:GetTypes(bool)

在System.Reflection.Assembly.GetTypes()[0x00000] in< ; filename unknown>:0

在Mono.CSharp.RootNamespace.ComputeNamespaces(System.Reflection.Assembly assembly,System.Type extensionType)[0x00000] in< filename unknown>:0

在Mono.CSharp.RootNamespace.ComputeNamespace(Mono.CSharp.CompilerContext ctx,System.Type extensionType)[0x00000] in< filename unknown>:0

在Mono.CSharp.GlobalRootNamespace在< filename未知>:0中的Mono.CSharp.Driver.LoadReferences()中的.ComputeNamespaces(Mono.CSharp.CompilerContext ctx)[0x00000] in< filename unknown>:0

在Mono.CSharp.Driver.Main(System.String []中的Mono.CSharp.Driver.Compile()[0x00000] in< filename unknown>:0

中, ] args)[0x00000] in< filename unknown>:0

/ p>


  • 我的dll在资源中的Plugins文件夹

  • 尝试将dll


  • 尝试使用和不使用命名空间

  • $ b

    顺便说一下,它在Unity Editor中工作正常,所以它应该很清楚,我做正确,因为我按照正式的插件制作指南中的说明。



    感谢您的帮助

    解决方案

    当我从 em>文件夹,而只保留它在项目根文件夹中的副本,它工作



    所以在这种情况下,解决方案是< >



    我不确定为什么,所以问题的一部分仍然是开放的。


    I spent some hours trying solutions I found online but nothing worked so here's my question for Stackoverflowers.

    I made a small plugin for Unity and imported the dll into my project folder. It works fine when I launch the game within the editor but if I try to compile I get the following:

    Internal compiler error. See the console log for more information. output was:
    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 
    

    What I did so far:

    • my dll is in the Plugins folder in Assets
    • tried to place the dll (also) in the project root
    • tried with and without namespaces
    • set .NET 2.0 in Unity

    And by the way, it works fine in Unity Editor so it should be pretty clear that I made it right as I followed the instructions in the official Plugins making guide.

    Thanks for any help

    解决方案

    When I deleted the dll from the Plugins folder while leaving just a copy of it in the project's root folder, it worked.

    So in this case the solution is to leave the dll just in the project's root folder and nowhere else.

    I'm not sure why though, so part of the question is still open.

    这篇关于Unity内部编译器错误与自定义dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆