4
Vote

How to properly add a reference to WPF MediaKit?

description

Since I'm interested in using DirectShow and / or Media Foundation in WPF, the WPF MediaKit seems like a good library for my needs. However, I haven't got it to work yet.
 
2 out of 5 .dlls can't be added as reference to my project. To following error is shown:
 
A reference to '....dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
 
The other dlls seem to work just fine, in code. But in the XAML designer, the WPF Media Kit doesn't seem to be usable at all.
 
xmlns:mk="clr-namespace:WPFMediaKit.DirectShow.Controls;assembly=WPFMediaKit"
 
The above line generates the following error:
 
Unable to load the metadata for assembly 'WPFMediaKit'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'WPFMediaKit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
 
Despite of this error, running my project is no problem.
 
What's happening here? And since when can you run projects whilst having errors in it?

comments

jarvis01123 wrote May 30, 2013 at 9:53 PM

Has anyone figured this out? Everyone seems to just use this kit but there's zero documentation that I can find and it's driving me nuts. I can't add 2 of the assemblies either, and so the whole kit is useless to me but I really want to use it for this project.

wrote May 30, 2013 at 9:53 PM

philb222 wrote Aug 13, 2013 at 9:07 PM

Hello,

I'm a newbie, so maybe no help. The xaml namespace you used is the same as mine. Did you remember to add the DLL to your 'References' in Solution Explorer?

I also cannot add 2 of the DLL's, the ones for EVRPresenter. According to ildasm.exe those 'have no valid CLR header'.

hardyesterhuizen wrote Jan 31, 2014 at 9:17 AM

In Windows Explorer navigate to the DLLs that you've added as a reference, right click and view properties. You will probably see a note at the bottom that "This file came from another computer and might be blocked...". If so click on the unblock button, and presto the references should work.

wrote Mar 30, 2015 at 10:01 AM