【问题标题】:Adding managed DLL to unity3d将托管 DLL 添加到 unity3d
【发布时间】:2016-04-17 08:38:12
【问题描述】:

我正在尝试实现 $p 库来识别游戏中的拼写手势,但我遇到了未处理的异常。我正在使用从他们的网站获得的预编译 dll 并在 .Net 4 框架中编译,所以我猜这就是问题所在。这是错误:

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 

Missing method .ctor in assembly C:\Users\Uri\Desktop\GestureSpell\GestureSpell\Assets\PDollarGestureRecognizer.dll, type System.Runtime.Versioning.TargetFrameworkAttribute
The class System.Runtime.Versioning.TargetFrameworkAttribute could not be loaded, used in PDollarGestureRecognizer
Can't find custom attr constructor image: C:\Users\Uri\Desktop\GestureSpell\GestureSpell\Assets\PDollarGestureRecognizer.dll mtoken: 0x0a00000d

【问题讨论】:

  • 只是出于好奇,您是否创建了一个全新的 framework 4 项目并添加了它?只是为了看看 DLL 是否有效?
  • 不,我没有,正如我所说,我只是从我得到的下载中将 dll 拖到项目中。您是否建议我重新编译我下载的解决方案并进行测试?
  • 不,您没有提到您已经下载了解决方案。看起来您只有 DLL 文件。没关系。
  • 重新编译解决方案以定位 .Net 2 似乎已经修复了它,但我收到了一堆警告,主要参考“System.Core”无法解析,所以我猜这会中断功能。
  • 你见过这个吗? Load System.Core from .NET 4

标签: c# dll unity3d unity5 gesture-recognition


【解决方案1】:

您可以尝试在 .csproj 文件中将 true 更改为 false。这在某些情况下会有所帮助。

【讨论】:

    猜你喜欢
    • 2017-10-16
    • 1970-01-01
    • 2016-12-12
    • 2018-04-04
    • 2019-01-08
    • 1970-01-01
    • 1970-01-01
    • 2018-03-19
    • 1970-01-01
    相关资源
    最近更新 更多