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

.NET 9 WPF project fails to start with WPFMediaKit 3.0.0 #111

Closed
KyleWorley opened this issue Jan 22, 2025 · 2 comments
Closed

.NET 9 WPF project fails to start with WPFMediaKit 3.0.0 #111

KyleWorley opened this issue Jan 22, 2025 · 2 comments

Comments

@KyleWorley
Copy link

Description

When trying to use the latest version of WPFMediaKit on a .net 9 WPF project the application will fail to start due to the following exception:

System.Windows.Markup.XamlParseException: "The invocation of the constructor on type 'WPFMediaKit.DirectShow.Controls.VideoCaptureElement' that matches the specified binding constraints threw an exception
...
Inner Exception
FileNotFoundException: Could not load file or assembly 'DirectShowLib-2005, Version=2.1.0.26626, Culture=neutral,
PublicKeyToken=67e7b740cdfc2d3f'.` The system cannot find the file specified.

The dll does exist in the project output directory and both the version and PublicKeyToken match what it is looking for.

Steps to Reproduce

  1. Create a new WPF project that is targeting .net 9.0
  2. Add WPFMediaKit 3.0.0 package to the project
  3. Add a VideoCaptureElement to the MainWindow
  4. Start the application

More Information

Before the latest updates I had been maintaining a private version of this project with support for .net 6. When I added that support I remember seeing this issue before, and I sort of remember it being caused by how the NuGet package is created. However, that was a while ago so I might be misremembering this issue. Please let me know if there is any more information I can provide.

@Sascha-L
Copy link
Owner

I'm sorry! It's a miserable hassle with creating a NuGet package and the native dependencies and the DirectShowLib. In the end, I thought it would work now, but obviously something was still cached.
I have now extracted and forked the DirectShowLib, migrated it to .NET 9 and created a separate NuGet package for it, which is used by WPF MediaKit. The two native EVRPresenter DLLs are now attached in such a way that they end up in the runtimes folder.
Hopefully everything should work now.

@KyleWorley
Copy link
Author

Thanks for fixing that so quickly! I can confirm that everything is working now.

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