gpt4 book ai didi

c# - 在 WPF 应用程序中加载 Interop.WMPLib Windows MediaPlayer 时出错

转载 作者:行者123 更新时间:2023-11-30 13:04:50 29 4
gpt4 key购买 nike

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.'

任何想法,我是否必须包含更多的 dll 或任何东西

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>

故意剪掉窗口标签

最佳答案

你应该安装 WMP Media Player,如果你已经安装了,然后在重新启动安装新的后卸载它。这可能是因为

  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.

关于c# - 在 WPF 应用程序中加载 Interop.WMPLib Windows MediaPlayer 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7139654/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com