question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load DLL 'OpenCvSharpExtern': The specified module could not be found.

See original GitHub issue

This looks to be a great library/wrapper, and I can setup and run the console app samples with no problem. However, I am trying to use this in a WebApiApplication that calls a custom library DLL, and am running into:

Unable to load DLL 'OpenCvSharpExtern': The specified module could not be found.

My project is structured such that the WebApiApplication calls a DLL form another project I created (and this is where the OpenCVSharp3 calls happen), so I have installed OpenCVSharp3-AnyCPU on both projects (MyWebApiProject and MyLibraryProject). I am using the NuGet install method, for OpenCVSharp3-AnyCPU (so OpenCV 3.0, as of the October 19, 2015 push to NuGet).

When I build and run the project, my bin directory(s) look like:

**MyWebApiProject**
Bin
│
├───dll
│   │
│   ├───x86
│   │   ├───msvcp120.dll
│   │   ├───msvcr120.dll
│   │   ├───opencv_ffmpeg300_64.dll
│   │   ├───opencv_world300.dll
│   │   └───OpenCvSharpExtern.dll
│   │
│   └───x64
│       ├───msvcp120.dll
│       ├───msvcr120.dll
│       ├───opencv_ffmpeg300_64.dll
│       ├───opencv_world300.dll
│       └───OpenCvSharpExtern.dll 
│   
├───OpenCvSharp.dll
├───OpenCvSharp.Blob.dll
├───OpenCvSharp.Extensions.dll
├───OpenCvSharp.UserInterface.dll
│
├───MyLibraryProject.dll
│
└───Additional DLL and binary files 

**MyLibraryProject**
Bin
│
├───dll
│   │
│   ├───x86
│   │   ├───msvcp120.dll
│   │   ├───msvcr120.dll
│   │   ├───opencv_ffmpeg300_64.dll
│   │   ├───opencv_world300.dll
│   │   └───OpenCvSharpExtern.dll
│   │
│   └───x64
│       ├───msvcp120.dll
│       ├───msvcr120.dll
│       ├───opencv_ffmpeg300_64.dll
│       ├───opencv_world300.dll
│       └───OpenCvSharpExtern.dll
│
├───OpenCvSharp.dll
├───OpenCvSharp.Blob.dll
├───OpenCvSharp.Extensions.dll
├───OpenCvSharp.UserInterface.dll
│
└───Additional DLL and binary files 

So to me, everything looks like it is in place.

However, the first time I call into an OpenCVSharp3 method (such as: Mat image = Mat.FromImageData(buffer, ImreadModes.Color);), I get the `Unable to load DLL ‘OpenCvSharpExtern’ error.

Does anyone have any idea how to use OpenCVSharp3 in a web application? Or could it be that my custom DLL is messing things up?

Any help would be greatly appreciated. I’m at a loss here.

Also, if it matters, I am using Visual Studio 2015 on .Net-Framework 4.5. ~Brett

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
shimatcommented, Oct 23, 2015

I have ever used OpenCvSharp in some ASP.NET MVC5 WebApi projects. I also bother about this problem. 😕

Please try to copy the native DLL files (opencv_*.dll, msvc*.dll and OpenCvSharpExtern.dll) from Bin\dll\[x86 or x64]\ to Bin\, or add the location of native DLLs to the PATH environment variable.

1reaction
titicruzcommented, Jan 24, 2020

I Got the same error and installed from NuGet “opencvsharp3-AnyCPU” and it removed the problem for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenCVSharp: Unable to load DLL 'OpenCvSharpExtern'
It is not enough installing the "OpencvSharp{version} nuget" package. ... Unable to load DLL (Module could not be found HRESULT: 0x8007007E) ...
Read more >
Unable to load DLL 'OpenCvSharpExtern' in 4.2.0 #818
Summary of your issue System.DllNotFoundException: Unable to load DLL 'OpenCvSharpExtern': The specified module could not be found.
Read more >
OpenCVSharp: Unable to load DLL 'OpenCvSharpExtern'
dll ' : The specified module could not be found. (Exception from HRESULT: 0x8007007E) - What is this error? UrhoSharp.Forms on UWP -...
Read more >
OpenCVSharp: Unable to load DLL 'OpenCvSharpExtern'
The problem is that it doesn't load OpenCvSharpExtern.dll. ... Unable to load DLL 'OpenCvSharpExtern': The specified module could not be found.
Read more >
Install opencv-contrib - ZEISS Microscopy Developer ...
Unable to load the DLL OpenCvSharpExtern: The specified module could not be found. when the debugger breaks at the line: "img = cv....
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