0

I'm trying to implement the $p library to recognize gestures for spell casting in a game but I'm getting a Unhandled Exception. I'm using the precompile dll I got from their website and its compiled in the .Net 4 framework, so I'm guessing this is where the problem is coming from. Here is the error:

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
Uri Popov
  • 2,127
  • 2
  • 25
  • 43
  • Just out of curiosity have you created a completely new framework 4 project and added it? Just to see if the DLL works at all? – pid Apr 17 '16 at 08:42
  • No i have not, as I said I just dragged the dll into the project from the download I got. Are you suggesting I recompile the solution I downloaded and test that ? – Uri Popov Apr 17 '16 at 08:43
  • No, you didn't mention you already had a solution downloaded. It looked like you only had the DLL file. Never mind. – pid Apr 17 '16 at 08:46
  • recompiling the solution to target .Net 2 seems to have fixed it but I got a bunch of warnings that The primary reference "System.Core" could not be resolved, so I'm guessing this will break the functionality. – Uri Popov Apr 17 '16 at 08:52
  • Have you seen this? [Load System.Core from .NET 4](http://stackoverflow.com/a/18561716/3227403) – pid Apr 17 '16 at 08:54
  • @pid Thanks for the help, but I have to be honest here I dont really understand the link you gave me. Compiling to .Net 3.5 solved all the warnings but one and still works in unity, so I'm going to go from there. – Uri Popov Apr 17 '16 at 09:02

1 Answers1

0

You can try changing true to false in your .csproj file. That helps in some cases.

radonthetyrant
  • 1,346
  • 1
  • 8
  • 13