OpenCvSharp4.Windows Unable to load DLL 'OpenCvSharpExtern'

See original GitHub issue

Summary of your issue

Getting OpenCvSharp4.Windows from nuget, try demo code of lenna, got this error

System.TypeInitializationException
  HResult=0x80131534
  Message=The type initializer for 'OpenCvSharp.NativeMethods' threw an exception.
  Source=OpenCvSharp
  StackTrace:
   at OpenCvSharp.NativeMethods.imgcodecs_imread(String filename, Int32 flags)
   at OpenCvSharp.Mat..ctor(String fileName, ImreadModes flags)
   at OpenCvSharpYolo3.Program.Main(String[] args) in D:\Users\Died.Liu\source\repos\OpenCvSharpYolo3\OpenCvSharpYolo3\Program.cs:line 14

Inner Exception 1:
DllNotFoundException: Unable to load DLL 'OpenCvSharpExtern': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Environment

package id=“OpenCvSharp4.Windows” version=“4.0.0.20181225” targetFramework=“net46” win 10 v1809 , vs2017 v18.8.9

What did you do when you faced the problem?

the demo code work on OpenCvSharp v3, it should be work at v4

Example code:

demo code

Quick fix

stupid way copy dll folder from previous project that using OpenCvSharp3. img put into your \bin\debug then it work, but I think it’s for v3 not v4.

Guess

Maybe it’s typo or something, @shimat can you check it ?

I noticed on frontpage ubuntu build Instructions have Build native wrapper OpenCvSharpExtern, so I think it maybe miss on OpenCvSharp4.Windows nuget package, it didn’t include OpenCvSharpExtern.dll,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
shimatcommented, Jan 8, 2019

Thanks. Please try the latest package. https://www.nuget.org/packages/OpenCvSharp4.Windows/4.0.0.20190108 The problem may be caused by my mistake in the .props file name.

1reaction
diedcommented, Jan 8, 2019

I test Sample-4.0.0-20181130.zip from release, it got same error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load DLL 'OpenCvSharpExtern' in 4.2.0 #818
I would just update the OpenCvSharp nuget references (OpenCvSharp4 and OpenCvSharp4.runtime.win currently on 4.2.0.20200108) which has support ...
Read more >
OpenCVSharp: Unable to load DLL 'OpenCvSharpExtern'
OpenCvSharpExtern.dll requires mfplat.dll that is part of the Media Feature Pack. Windows 'N' editions do not include this by default.
Read more >
OpenCVSharp: Unable to load DLL 'OpenCvSharpExtern'
OpenCvSharpExtern.dll requires mfplat.dll that is part of the Media Feature Pack. Windows 'N' editions do not include this by default.
Read more >
opencvsharp
dll / libOpenCvSharpExtern.so) is required to work OpenCvSharp. To use OpenCvSharp, you should add both OpenCvSharp4 and OpenCvSharp4. runtime.
Read more >
OpenCVSharp: Unable to load DLL 'OpenCvSharpExtern'
I have installed the latest OpenCVSharp 2 (2.4.10.201…) with the NuGet manager in my project. Everything concerning OpenCVSharp.CvMat is working OK (loading ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found