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 System.DllNotFoundException 0x8007007E when dragging control onto WinForm #1710

Open
jeffdavis503 opened this issue Oct 15, 2024 · 1 comment

Comments

@jeffdavis503
Copy link

Summary of your issue

When dragging a control in the same solution made with OpenCVSharp 4.10 onto a winform an exception is thrown. The solution builds without error.

image

Environment

Windows 10 Enterprise Build 19045. Visual Studio 2019 C# .NET Framework 4.8 AnyCPU

What did you do when you faced the problem?

I have copied the files from the dll\x86\ folder into the bin\Debug folder.
I have run Dependcy walker and it shows no missing DLLS beside the API- etc ones that are not really missing
Windows Media Features are installed
Installed NuGet Packages for 4.10.0.20240616
OpenCVSharp4
OpenCVSharp4.Extensions
OpenCVSharp4.runtime.win
OpenCVSharp4.Windows
OpenCVSharp4.WpfExtensions

Example code:

		private readonly int _fourcc = VideoWriter.FourCC('M', 'P', '4', 'V');

Output:

Failed to create component 'WebCamControl'. The error message follows:
'System.TypelnitializationException: The type initializer for OpenCvSharp.Internal.NativeMethods' threw an exception. ---> System.DIINotFoundException: Unable to load DLL OpenCvSharpExtern': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at OpenCvSharp.Internal.NativeMethods.redirectError(CvErrorCallback errCallback, IntPtr userdata, IntPtr& prevUserdata)
at OpenCvSharp.Internal.NativeMethods.LoadLibraries(IEnumerable`1 additionalPaths)
at OpenCvSharp.Internal.NativeMethods..cctor() --- End of inner exception stack trace ---
at OpenCvSharp.Internal.NativeMethods.videoio_VideoWriter_fourcc(SByte c1, SByte c2, SByte c3, SByte c4, Int32& returnValue)
at OpenCvSharp.VideoWriter.FourCC(Char c1, Char c2, Char c3, Char (4) at WebCamDemo.WebCamControl..ctor() in WebCamControl.cs:line 35'
paste your output


## What did you intend to be?
Control should be able to be moved onto a form.
@jeffdavis503
Copy link
Author

I have tried all suggested fixes with no luck. I still get the exception

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

1 participant