Skip to content

OpenCVSharp Version 4 depends on mfplat.dll #589

@grisharav

Description

@grisharav

Summary of your issue

When deploying our application that was upgraded to latest OpenCVSharp all worked fine in desktop environment, but when I tried to use OpenCVSharp 4.0.0 on Win 2012 R2 environment I got:

System.TypeInitializationException : The type initializer for 'OpenCvSharp.NativeMethods' threw an exception.
---- System.DllNotFoundException : Unable to load DLL 'OpenCvSharpExtern' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at OpenCvSharp.NativeMethods.core_Mat_new2(Int32 rows, Int32 cols, Int32 type)
at OpenCvSharp.Mat..ctor(Size size, MatType type) in C:\projects\opencvsharp\src\OpenCvSharp\Modules\core\Mat\Mat.cs:line 121

After some digging and running Procmon, I noticed that the code tries to load C:\Windows\System32\mfplat.dll

I installed Windows Server Essentials Media Pack (https://www.microsoft.com/en-us/download/details.aspx?id=40837), and got the dependency satisfied, but I believe the code should run in server environment since no device interaction is performed.

Environment

Windows Server 2012 R2

What did you do when you faced the problem?

Just run any code referencing OpenCVSharp on a server without mfplat.dll available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions