"Emgu.CV.CvInvoke”的类型初始值设定项引发异常 解决办法

系统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>XXXis 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.dllwhereXXXis 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.dllwhereXXXis 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”的类型初始值设定项引发异常 解决办法的更多相关文章
- Emgu.CV.CvInvoke的类型初始值设定项引发异常”TypeInitializationException”的问题
问题如图: 解决方案: 1.记住EmguCV的安装位置:X:\XXX\XXX… 本测试方案中EmguCV的安装位置:D:\Emgu,操作时记得用自己的EmguCV安装路径替换掉D:\Emgu. 2.添 ...
- Emgu.CV.CvInvoke”的类型初始值设定项引发异常
http://zhidao.baidu.com/link?url=VHkw3qZxp7HumQX_r-4ljPiy-N4A7yNK1Xn5q6tjPb16WvBGy6RFKrmKEhtgJ2PACAk ...
- Emgu.CV.CvInvoke的类型初始值设定项引发异常
被这个问题蛋疼了一个下午,终于解决了.我的服务器出现这个问题的原因:可能是没有安装emgucv. 解决方法: 1.下载并安装emgucv 下载地址:链接: https://pan.baidu.com/ ...
- MathWorks.MATLAB.NET.Arrays.MWArray”的类型初始值设定项引发异常 解决方法
原因 用的是matlab7运行时,后面又安装了matlab11,后面又重新安装了matlab7运行时,c盘下就有二个运行时的版本了,程序引用了后面的那个,编译后就出上面的问题 解决方法 1重新引用上面 ...
- C#中异常:“The type initializer to throw an exception(类型初始值设定项引发异常)”的简单分析与解决方法
对于C#中异常:“The type initializer to throw an exception(类型初始值设定项引发异常)”的简单分析,目前本人分析两种情况,如下: 情况一: 借鉴麒麟.NET ...
- “System.Data.SqlClient.SqlConnection”的类型初始值设定项引发异常---解决方案
"System.Data.SqlClient.SqlConnection"的类型初始值设定项引发异常 问题出在了 .net 的C:\WINDOWS\Microsoft.NET\Fr ...
- Memcached Memcached.ClientLibrary.SockIOPool”的类型初始值设定项引发异常
又一次遭遇"xxx类型初始值设定项引发异常" 下了个c#实现的轻量级IoC开源项目,可是在本地使用时发现一运行就捕捉到"类型初始值设定项引发异常"的异常信息,调 ...
- “System.Transactions.Diagnostics.DiagnosticTrace”的类型初始值设定项引发异常[WCF]
未处理System.TypeInitializationException HResult=-2146233036 Message=“System.ServiceModel.Diagnostics ...
- System.Data.Entity.Internal.AppConfig 类型初始值设定项引发异常
在一开始时将connectionStrings 写在了configSections之上如下图一示,结果抛出:“System.Data.Entity.Internal.AppConfig”的类型初始值设 ...
随机推荐
- 启动mysql时显示:/tmp/mysql.sock 不存在的解决方法
启动mysql时显示:/tmp/mysql.sock 不存在的解决方法 启动mysql时报错的解决(mysql 5.0.45 redhat as 43) ====================== ...
- php应用jquery做ajax操作
以下是全部代码: <html> <head> <title>jQuery Ajax 实例演示</title> </head> <scr ...
- android setDestinationInExternalPublicDir 下载到SD卡根目录
一:setDestinationInExternalPublicDir(“Trinea”, “MeiLiShuo.apk”);表示设置下载地址为sd卡的Trinea文件夹,文件名为MeiLiShuo. ...
- 深入理解java内存模型系列文章
转载关于java内存模型的系列文章,写的非常好. 深入理解java内存模型(一)--基础 深入理解java内存模型(二)--重排序 深入理解java内存模型(三)--顺序一致性 深入理解java内存模 ...
- hadoop2.6.2+hbase+zookeeper环境搭建
1.hadoop环境搭建,版本:2.6.2,参考:http://www.cnblogs.com/bookwed/p/5251393.html 启动服务:在master机器上,进入hadoop安装目录, ...
- 【转】SVN提交一般原则
写在前面: 最近, 跳槽了. 来到了一家感觉QIAN景不错的创业公司. 由于是开始, 规模比较小, SVN的管理工作, 也有我来承担. 今天发生了一些相当不愉快的事情, 就是因为一个同事, ①签入代码 ...
- redis配置文件redis.conf中文版
转账自:http://www.jb51.net/article/50605.htm # Redis示例配置文件 # 注意单位问题:当需要设置内存大小的时候,可以使用类似1k.5GB.4M这样的常见格式 ...
- 报表开发之批量导入导出excel
在日常使用报表过程中,会有这样一种情况,你将Excel表分发给各个员工,员工填完后,统一整理成多个Excel,你需要将这些数据,用报表的填报功能,提交录入到数据库中,这样一来可避免到服务器机房录数据的 ...
- js数组中的常用方法总结
栈方法(后进先出) ArrayObj.push()方法 ArrayObj.pop()方法 ArrayObj.push():就是向数组末尾添加新的元素,返回的是数组新的长度.ArrayObj.pop() ...
- 使用Ecplise git commit时出现"There are no stages files"
异常 解决方案 进入Window--Preferences--Team--Git--Committing,反选下图红圈部分: 保存后即可出线我们熟悉的提交代码界面啦: