- Home /
How to fix TypeLoadException (EmguCV + Unity3d)
Hi, I am trying to integrate EmguCV (OpenCV Wrapper) with Unity3d. For this purpose I followed This tutorial and complete all the required steps. But when I run the program of face detection script in Unity, it gives the error of TypeLoadException
Now I am using :
EmguCV : emgucv-windesktop_x64-cuda 3.1.0.2504
Unity 2017.4.0f1 (with experimental .NET 4.6 set on it in Build>Player Settings>Other Settings)
Monodevelop 5.9.6
OS : Window 7 (x64 bit)
I installed the Emgu CV , set the environment variable paths, created the Scene in Unity3d and added the face detection script in it. And I Add the required DLL files in Unity Asset Folder.
Note that I set the Experimental .NET 4.6 version in Unity because the Emgu.CV.DebuggerVisualizers DLL files are only supported on .NET 4.x versions.
Now the Problem: When I run the program in Unity, it gives the error of TypeLoadException
TypeLoadException: Could not set up parent class, due to: Could not load file or assembly 'Microsoft.VisualStudio.DebuggerVisualizers, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.VisualStudio.DebuggerVisualizers, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none> assembly:C:\Users\Public\Documents\Unity Projects\EmguCvExample\Assets\Emgu.CV.DebuggerVisualizers.VS2010.dll type:BaseImageVisualizer member:<none>
System.RuntimeType.GetMethodsByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.Boolean ignoreCase, System.RuntimeType reflectedType) (at <c95265f74fdf4905bfb0d5a4b652216c>:0)
System.RuntimeType.GetMethodCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.CallingConventions callConv, System.Type[] types, System.Boolean allowPrefixLookup) (at <c95265f74fdf4905bfb0d5a4b652216c>:0)
System.RuntimeType.GetMethods (System.Reflection.BindingFlags bindingAttr) (at <c95265f74fdf4905bfb0d5a4b652216c>:0)
UnityEditor.Build.BuildPipelineInterfaces.InitializeBuildCallbacks (UnityEditor.Build.BuildPipelineInterfaces+BuildCallbacks findFlags) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:189)
Please help me. How can I solve the error of TypeLoadException, to successfully integrate the Emgu CV into Unity3d.
Thanks in Advance