Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load DLL 'OpenCvSharpExtern' or one of its dependencies #1664

Open
NonicaTeam opened this issue Apr 20, 2024 · 1 comment
Open

Comments

@NonicaTeam
Copy link

NonicaTeam commented Apr 20, 2024

Summary of your issue

Environment

Net8.0

What did you do when you faced the problem?

Migrate Opencvsharp4.0 from net framework to net8.0 using visual studio migration. As it was raising the issue, I uninstall and reinstall different versions but I am unable to get it working.
I have OpenCVSharp4 and OpenCVSharp4.runtime.win installed and built in my output directory. I also tried to copy the runtimes (opencv_videoio_ffmpeg490_64.dll, OpenCvSharpExtern.dll) next to the main OpenCvSharp.dll but it did not work either.
I have tried soo many solutions online but could not get it working. Taget framework is x64 and those dll were copied next to main dll. I also added System.memory and system.compiler.unsafe next to it.

Example code:

var edgedetection = Cv2.ImRead(init_hdlr_image);

Output:

DllNotFoundException: Unable to load DLL 'OpenCvSharpExtern' or one of its dependencies: The specified module could not be found. (0x8007007E)
System.TypeInitializationException: 'The type initializer for 'OpenCvSharp.Internal.NativeMethods' threw an exception.'

What did you intend to be?

No error and loading properly

@AvenSun
Copy link
Contributor

AvenSun commented May 7, 2024

It looks like some dll missing, you can check this first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants