"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>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
whereXXX
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
whereXXX
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”的类型初始值设定项引发异常 解决办法的更多相关文章
- 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”的类型初始值设 ...
随机推荐
- linux中5条查找命令
1 which which命令的作用是,在PATH变量指定的路径中,搜索某个系统命令的位置,并且返回第一个搜索结果. which [文件...] 参 数: -n<文件名长度> 指定文件名长 ...
- 小结-stm32 驱动LED灯
使用位带操作,位带操作就是把每个比特膨胀成一个32位的字,当访问这些字的时候就访问这些比特位. http://www.cnblogs.com/xiaobo-Linux/ 然后,端口使能: //³õʼ ...
- 使用github之前的技能准备
Git的导入 介绍 Git属于分散型版本管理系统,是为版本管理而设计的软件.版本管理就是管理更新的历史记录.它为我们提供了一些在软件开发过程中必不可少的功能,例如记录一款软件添加或更改源代码的过程,回 ...
- WPF系列 Path表示语法详解(Path之Data属性语法)
示例: XAML(代码A): <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...
- 《InsideUE4》-5-GamePlay架构(四)Pawn
<InsideUE4>-5-GamePlay架构(四)Pawn Tags: InsideUE4 我像是一颗棋 进退任由你决定 我不是你眼中唯一将领 却是不起眼的小兵 引言 欢迎来到Game ...
- 【2016-10-28】【坚持学习】【Day15】【MongoDB】【初识】
其实公司产品一直有使用mongodb,只不过我一直没有接触这一块,也没有主动的了解.实在说不过去.于是,准备写几个文章,认真学习一下它. 今天花了几个小时学习了入门 定义: 非关系型数据库, NoSQ ...
- OpenStack 企业私有云的若干需求(6):大规模扩展性支持
本系列会介绍OpenStack 企业私有云的几个需求: 自动扩展(Auto-scaling)支持 多租户和租户隔离 (multi-tenancy and tenancy isolation) 混合云( ...
- C#.NET 大型企业信息化系统集成快速开发平台 4.2 版本 - 基于数据库资源的多语言实现
以前的开发平台里,是用xml语言包实现了多语言功能,现在新的平台里进行了调整,把多语言包资源放在数据库表里实现了. 我们系统预留了多语言的配置全局变量.可以通过配置这个参数达到切换多语言的目的 我们在 ...
- php $CI =& get_instance();
初学php 看有人这样写,$CI =& get_instance(); 要你自定义的类库中访问CodeIgniter的原始资源,你必须使用 get_instance() 函数.这个函数返回一个 ...
- VPN使用指南|稳定的VPN|
之前一直用GoagentFQ,但是有时不太稳定,网速也不是很快,然后就试用了云梯VPN,感觉还不错,网速挺快,也比较稳定.http://opticalvpn.com/?r=72ec52481ab8d2 ...