Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将托管DLL添加到unity3d_C#_Dll_Unity3d_Unity5_Gesture Recognition - Fatal编程技术网

C# 将托管DLL添加到unity3d

C# 将托管DLL添加到unity3d,c#,dll,unity3d,unity5,gesture-recognition,C#,Dll,Unity3d,Unity5,Gesture Recognition,我试图实现$p库来识别游戏中施法的手势,但我遇到了一个未处理的异常。我使用的是从他们网站上获得的预编译dll,它是在.NET4框架下编译的,所以我猜这就是问题的根源。以下是错误: Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflect

我试图实现$p库来识别游戏中施法的手势,但我遇到了一个未处理的异常。我使用的是从他们网站上获得的预编译dll,它是在.NET4框架下编译的,所以我猜这就是问题的根源。以下是错误:

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
未处理的异常:System.Reflection.ReflectionTypeLoadException:无法加载模块中的类。
at(包装器管理到本机)System.Reflection.Assembly:GetTypes(bool)
位于:0中的System.Reflection.Assembly.GetTypes()[0x00000]处
位于:0中的Mono.CSharp.RootNamespace.ComputeNamespaces(System.Reflection.Assembly,System.Type extensionType)[0x00000]
位于:0中的Mono.CSharp.RootNamespace.ComputeNamespace(Mono.CSharp.CompilerContext ctx,System.Type extensionType)[0x00000]
位于:0中的Mono.CSharp.GlobalRootNamespace.ComputeNamespaces(Mono.CSharp.CompilerContext ctx)[0x00000]
在0中的Mono.CSharp.Driver.LoadReferences()[0x00000]处
在0中的Mono.CSharp.Driver.Compile()[0x00000]处
在:0中的Mono.CSharp.Driver.Main(System.String[]args)[0x00000]处
程序集C:\Users\Uri\Desktop\GestureSpell\GestureSpell\Assets\PDollargestureRecogniter.dll中缺少方法.ctor,键入System.Runtime.Versioning.TargetFrameworkAttribute
无法加载类System.Runtime.Versioning.TargetFrameworkAttribute,该属性在PDollargestureRecogniter中使用
找不到自定义attr构造函数映像:C:\Users\Uri\Desktop\GestureSpell\GestureSpell\Assets\PDollargesturererecognizer.dll mtoken:0x0a00000d

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

只是出于好奇,您是否创建了一个全新的framework 4项目并添加了它?只是想看看DLL是否能工作?不,我没有,正如我说的,我只是从下载中把DLL拖到项目中。你是建议我重新编译我下载的解决方案并进行测试吗?不,你没有提到你已经下载了一个解决方案。看起来您只有DLL文件。没关系。重新编译到目标.Net 2的解决方案似乎已经修复了它,但我收到了一系列警告,主要参考“System.Core”无法解决,因此我猜这将破坏功能。您看到了吗?