Error loading Interop.WMPLib Windows MediaPlayer in WPF application

Error 1 Unknown build error, 'Cannot resolve dependency to assembly 'Interop.WMPLib, Version=1.0.0.0, Culture=neutral PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event. Line 20 Position 14.' 

Any ideas I need to include more dlls or something like that

WPF

 <Window ... xmlns:activeXControl="clr-namespace:AxWMPLib;assembly=AxInterop.WMPLib"> <Grid> <WindowsFormsHost x:Name="winFormsHost" Grid.Column="1"> <activeXControl:AxWindowsMediaPlayer x:Name="activeXMediaPlayer"/> </WindowsFormsHost> </Grid> </Window> 

Window shortcut specially cut

+4
source share
1 answer

You must install WMP Media Player, if you have already installed it, and then uninstall it after rebooting, install a new one. Perhaps this is possible because

  1.COM dll is not registered properly 2.Because of loading different version of Interop dll(i mean DLL Hell). 3.Dll not loaded Properly because ofplateform Compatibility or Others. 
0
source

All Articles