2013-05-07 85 views
3

我已经writen简单编程'使用EmguCV面对detectedin VS 2010的C#,但我得到以下异常:误差“Emgu.CV.CvInvoke”的类型初始值引发了异常与C#,opencv的和EmguCv

The type initializer for 'Emgu.CV.CvInvoke' threw an exception. 

即时试图修复此后续链接:http://www.emgu.com/wiki/index.php/Download_And_Installation#The_type_initializer_for_.27Emgu.CV.CvInvoke.27_threw_an_exception

我复制了所有的DLL,但仍然错误。

我使用窗口7 Pro的X86,VS 2010,EmguCV2.4.2并按照本教程:http://www.youtube.com/watch?v=vdjoutNR2DQ

帮帮我吧!

+0

您应该包括异常*全*堆栈跟踪,包括嵌套异常。 (InnerException) – 2013-05-07 09:50:14

+0

'InnerException'可能告诉你到底是什么问题; 'InnerException'说什么? – 2013-05-07 09:51:03

+0

我包括完整的堆栈:( – guensuanhoa 2013-05-07 10:02:57

回答

0

@Marc Gravell:这是我proplem

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box. 

************** Exception Text ************** 
System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'opencv_core242': The specified module could not be found. (Exception from HRESULT: 0x8007007E) 
at Emgu.CV.CvInvoke.cvRedirectError(CvErrorCallback errorHandler, IntPtr userdata, IntPtr prevUserdata) 
at Emgu.CV.CvInvoke..cctor() 
--- End of inner exception stack trace --- 
at Emgu.CV.CvInvoke.cvCreateCameraCapture(Int32 index) 
at Emgu.CV.Capture..ctor(Int32 camIndex) 
at Emgu.CV.Capture..ctor() 
at WindowsFormsApplication2.Form1.Form1_Load(Object sender, EventArgs e) in D:\khtn\new\do an\project\WindowsFormsApplication2\WindowsFormsApplication2\Form1.cs:line 45 
at System.Windows.Forms.Form.OnLoad(EventArgs e) 
at System.Windows.Forms.Form.OnCreateControl() 
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 
at System.Windows.Forms.Control.CreateControl() 
at System.Windows.Forms.Control.WmShowWindow(Message& m) 
at System.Windows.Forms.Control.WndProc(Message& m) 
at System.Windows.Forms.ScrollableControl.WndProc(Message& m) 
at System.Windows.Forms.Form.WmShowWindow(Message& m) 
at System.Windows.Forms.Form.WndProc(Message& m) 
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 

************** Loaded Assemblies ************** 
mscorlib 
Assembly Version: 4.0.0.0 
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) 
CodeBase: file:///G:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll 
---------------------------------------- 
WindowsFormsApplication2 
Assembly Version: 1.0.0.0 
Win32 Version: 1.0.0.0 
CodeBase: file:///D:/khtn/new/do%20an/project/WindowsFormsApplication2/WindowsFormsApplication2/bin/Debug/WindowsFormsApplication2.exe 
---------------------------------------- 
System.Windows.Forms 
Assembly Version: 4.0.0.0 
Win32 Version: 4.0.30319.1 built by: RTMRel 
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll 
---------------------------------------- 
System.Drawing 
Assembly Version: 4.0.0.0 
Win32 Version: 4.0.30319.1 built by: RTMRel 
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll 
---------------------------------------- 
System 
Assembly Version: 4.0.0.0 
Win32 Version: 4.0.30319.1 built by: RTMRel 
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll 
---------------------------------------- 
Emgu.CV 
Assembly Version: 2.4.2.1777 
Win32 Version: 2.4.2.1777 
CodeBase: file:///D:/khtn/new/do%20an/project/WindowsFormsApplication2/WindowsFormsApplication2/bin/Debug/Emgu.CV.DLL 
---------------------------------------- 
Emgu.Util 
Assembly Version: 2.4.2.1777 
Win32 Version: 2.4.2.1777 
CodeBase: file:///D:/khtn/new/do%20an/project/WindowsFormsApplication2/WindowsFormsApplication2/bin/Debug/Emgu.Util.DLL 
---------------------------------------- 
System.Configuration 
Assembly Version: 4.0.0.0 
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) 
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll 
---------------------------------------- 
System.Xml 
Assembly Version: 4.0.0.0 
Win32 Version: 4.0.30319.1 built by: RTMRel 
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll 
---------------------------------------- 
Emgu.CV.UI 
Assembly Version: 2.4.2.1777 
Win32 Version: 2.4.2.1777 
CodeBase: file:///D:/khtn/new/do%20an/project/WindowsFormsApplication2/WindowsFormsApplication2/bin/Debug/Emgu.CV.UI.DLL 
---------------------------------------- 

************** JIT Debugging ************** 
To enable just-in-time (JIT) debugging, the .config file for this 
application or computer (machine.config) must have the 
jitDebugging value set in the system.windows.forms section. 
The application must also be compiled with debugging 
enabled. 

For example: 

    <configuration> 
    <system.windows.forms jitDebugging="true" /> 
    </configuration> 

    When JIT debugging is enabled, any unhandled exception 
    will be sent to the JIT debugger registered on the computer 
    rather than be handled by this dialog box. 
+0

我复制了所有dll文件夹调试,但仍然错误 – guensuanhoa 2013-05-07 10:11:22

+0

您的详细的错误信息应该包括作为您的问题的一部分,不作为“答案”给出。 – 2015-06-25 14:46:40

相关问题