OpenCVSharp: Não foi possível carregar a DLL 'OpenCvSharpExtern'
Instalei o OpenCVSharp 2 mais recente (2.4.10.201 ...) com o gerenciador do NuGet no meu projeto. Tudo sobre o OpenCVSharp.CvMat está funcionando bem (carregamento, manipulação etc.), por isso estou certo de que a instalação está correta.
No entanto, não consigo usar o OpenCVSharp.CPlusPlus!O problema é que ele não carrega o OpenCvSharpExtern.dll.
Erro mostrado no bloco try-catch:
try
{
Mat mat = new Mat();
} catch (Exception err)
{
Console.WriteLine( err );
}
System.TypeInitializationException: The type initializer for 'OpenCvSharp.CPlusPlus.Mat' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'OpenCvSharpExtern': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at OpenCvSharp.CPlusPlus.NativeMethods.core_Mat_sizeof()
at OpenCvSharp.CPlusPlus.Mat..cctor()
--- End of inner exception stack trace ---
at OpenCvSharp.CPlusPlus.Mat..ctor()
at MainClass.Main() in C:\Users\kotsias\Documents\Visual Studio 2015\Projects\MyCVSharp\ConsoleApplication1\Test.cs:line 14
oOpenCvSharpExtern.dll É implantado ao lado do meu .exe nas seguintes subpastas:
.. \ dll \ x86
&
.. \ dll \ x64
Se eu copiar manualmente ox64 .dll na mesma pasta do meu .exe, ainda recebo o mesmo erro acima. Se eu copiar ox86 .dll, Recebo um erro diferente:
System.TypeInitializationException: The type initializer for 'OpenCvSharp.CPlusPlus.Mat' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at OpenCvSharp.CPlusPlus.NativeMethods.core_Mat_sizeof()
at OpenCvSharp.CPlusPlus.Mat..cctor()
--- End of inner exception stack trace ---
at OpenCvSharp.CPlusPlus.Mat..ctor()
at MainClass.Main() in C:\Users\kotsias\Documents\Visual Studio 2015\Projects\MyCVSharp\ConsoleApplication1\Test.cs:line 14