系统win7 32位,只在这一台电脑上出现这种问题,已知VS编译是X86,在数台电脑上测试都正常。

后来把opencv的dll路径例如 E:\...\x86  加入到系统环境变量中就正常了。

emgucv安装里opencv的dll路径是这个样子 C:\Emgu\emgucv-windows-universal 3.0.0.2157\bin\x86,发布时把bin下的dll包括x86等拷贝到程序安装目录下。

但很奇怪这一台电脑无法使用,理论上emgucv发布不需要环境变量的。

还是要继续研究,欢迎知道的解答下。

官方解释:

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

If you see this exception, please check the following

Have you installed MSVCRT?

  • For Version 3.0+, the required vcrt dlls are included in the "x86" and "x64" folder. You will be ready as long as you copy all the unmanaged dlls in the "x86" and "x64" folder to the folder of executable.
  • For Version 2.4+, the bundled OpenCV binary is build with Visual Studio 2010, you will needs to installed MSVCRT 10.0 SP1 x86 or MSVCRT 10.0 SP1 x64 to resolve the dependency issue.
  • For Version 2.0+, the bundled OpenCV binary is build with Visual Studio 2008, you will needs to installed MSVCRT 9.0 SP1 to resolve the dependency issue.
  • For Version 1.5, the bundled OpenCV pre1.1 binary is build with Visual Studio 2005, you will needs to installed MSVCRT 8.0 SP1 to resolve the dependency issue.

Have you copied the OpenCV dlls to the execution directory?

  • Make sure the unmanaged DLLs are in the execution directory.

    • For Emgu CV version >=2.4.2, this means the "x86" and "x64" folder and all the dlls within the folders. The folder names and file structures should not be altered when deploying with the application.
    • For EMGU CV version 2.4 cudart64_42_9.dll, cvextern.dll, npp64_42_9.dll, opencv_calib3dXXX.dll, opencv_contribXXX.dll, opencv_coreXXX.dll, opencv_features2dXXX.dll, opencv_flannXXX.dll, opencv_highguiXXX.dll, opencv_imgprocXXX.dll, opencv_legacyXXX.dll, opencv_mlXXX.dll, opencv_nonfreXXX.dll, opencv_objectdetectXXX.dll, opencv_videoXXX.dll,</code?> where <code>XXX is the OpenCV version number.
    • For Emgu CV version 2.2, 2.3 this means the following dlls: opencv_calib3dXXX.dll, opencv_contribXXX.dll, opencv_coreXXX.dll, opencv_features2dXXX.dll, opencv_highguiXXX.dll, opencv_imgprocXXX.dll, opencv_legacyXXX.dll, opencv_mlXXX.dll, opencv_objectdetectXXX.dll, opencv_videoXXX.dll where XXX is the OpenCV version number.
    • For Emgu CV version <= 2.1, this means the following dlls:cvXXX.dll, cvauxXXX.dll, cxcoreXXX.dll, highguiXXX.dll, opencv_ffmpegXXX.dll, mlXXX.dllcvextern.dll where XXX is the OpenCV version number.
  • The best way to set up your project is:

    • Copy the unmanaged DLLs to your project folder
    • Right click on the project, click Add->Existing Item and select all unmanaged DLLs. Add them to the project.
    • For each of the included Dlls, left click on it, find the "Copy to Output Directory" option and select "Copy if newer"

Are you missing any dependency?

Download Dependency Walker and use it to open the "cvextern.dll" file. Check if any dependency is missing.

I have checked all of above but I still got the Exception

In this case, please try to build and run the examples. After building the examples, try to run the "Hello World" Program.

If "Hello World" runs without any problem, compare it with you project, find the difference in configuration and fix it.

If "Hello World" get the same "The type initializer for 'Emgu.CV.CvInvoke' threw an exception." message, try to find out the InnerException and report it to the discussion forum

"Emgu.CV.CvInvoke”的类型初始值设定项引发异常 解决办法的更多相关文章

  1. Emgu.CV.CvInvoke的类型初始值设定项引发异常”TypeInitializationException”的问题

    问题如图: 解决方案: 1.记住EmguCV的安装位置:X:\XXX\XXX… 本测试方案中EmguCV的安装位置:D:\Emgu,操作时记得用自己的EmguCV安装路径替换掉D:\Emgu. 2.添 ...

  2. Emgu.CV.CvInvoke”的类型初始值设定项引发异常

    http://zhidao.baidu.com/link?url=VHkw3qZxp7HumQX_r-4ljPiy-N4A7yNK1Xn5q6tjPb16WvBGy6RFKrmKEhtgJ2PACAk ...

  3. Emgu.CV.CvInvoke的类型初始值设定项引发异常

    被这个问题蛋疼了一个下午,终于解决了.我的服务器出现这个问题的原因:可能是没有安装emgucv. 解决方法: 1.下载并安装emgucv 下载地址:链接: https://pan.baidu.com/ ...

  4. MathWorks.MATLAB.NET.Arrays.MWArray”的类型初始值设定项引发异常 解决方法

    原因 用的是matlab7运行时,后面又安装了matlab11,后面又重新安装了matlab7运行时,c盘下就有二个运行时的版本了,程序引用了后面的那个,编译后就出上面的问题 解决方法 1重新引用上面 ...

  5. C#中异常:“The type initializer to throw an exception(类型初始值设定项引发异常)”的简单分析与解决方法

    对于C#中异常:“The type initializer to throw an exception(类型初始值设定项引发异常)”的简单分析,目前本人分析两种情况,如下: 情况一: 借鉴麒麟.NET ...

  6. “System.Data.SqlClient.SqlConnection”的类型初始值设定项引发异常---解决方案

    "System.Data.SqlClient.SqlConnection"的类型初始值设定项引发异常 问题出在了 .net 的C:\WINDOWS\Microsoft.NET\Fr ...

  7. Memcached Memcached.ClientLibrary.SockIOPool”的类型初始值设定项引发异常

    又一次遭遇"xxx类型初始值设定项引发异常" 下了个c#实现的轻量级IoC开源项目,可是在本地使用时发现一运行就捕捉到"类型初始值设定项引发异常"的异常信息,调 ...

  8. “System.Transactions.Diagnostics.DiagnosticTrace”的类型初始值设定项引发异常[WCF]

    未处理System.TypeInitializationException  HResult=-2146233036  Message=“System.ServiceModel.Diagnostics ...

  9. System.Data.Entity.Internal.AppConfig 类型初始值设定项引发异常

    在一开始时将connectionStrings 写在了configSections之上如下图一示,结果抛出:“System.Data.Entity.Internal.AppConfig”的类型初始值设 ...

随机推荐

  1. strstr 函数的实现

    strstr函数:返回主串中子字符串的位置后的所有字符. #include <stdio.h> const char *my_strstr(const char *str, const c ...

  2. 基于Zabbix IPMI监控服务器硬件状况

    基于Zabbix IPMI监控服务器硬件状况 zabbix ipmi 公司有多个分部,且机房没有专业值班,机房等级不够.在这种情况下,又想实时监控机房环境,于是使用IPMI方式来达到目的.由于之前已经 ...

  3. 轻松搞懂WebService工作原理

    用更简单的方式给大家谈谈WebService,让你更快更容易理解,希望对初学者有所帮助. WebService是基于网络的.分布式的模块化组件. 我们直接来看WebService的一个简易工作流程: ...

  4. Android(Linux)线路规程的使用

        一般来说,车载导航主机都需要外接若干个UART的外设,如支持HFP的蓝牙模块.与原车通信的CAN解码盒模块.u-blox的GPS模块和DVD机芯等.早年使用Telechips TCC8902+ ...

  5. MBTI-性格测试

  6. AC日记——最大数 洛谷 P1198 [JSOI2008]

    题目描述 现在请求你维护一个数列,要求提供以下两种操作: 1. 查询操作. 语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值. 限制:L不超过当前数列的长度. 2. 插入操作 ...

  7. centos 7 安装音乐播放器(亲测可用)(转载)

    http://www.cnblogs.com/boyiliushui/p/4530625.html

  8. rsyslog及logrotate小结

    [root@node1 logrotate.d]# ls dracut haproxy httpd mcelog nginx ppp psacct syslog yum   yum install n ...

  9. 基于spring-boot的rest微服务框架

    周末在家研究spring-boot,参考github上的一些开源项目,整了一个rest微服务框架,取之于民,用之于民,在github上开源了,地址如下: https://github.com/yjmy ...

  10. MATLAB神经网络原理与实例精解视频教程

    教程内容:<MATLAB神经网络原理与实例精解>随书附带源程序.rar9.随机神经网络.rar8.反馈神经网络.rar7.自组织竞争神经网络.rar6.径向基函数网络.rar5.BP神经网 ...