系统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