Windows Media Player无法使用Visual Studio应用程序在Windows XP上运行

时间:2011-08-08 13:20:56

标签: vb.net winforms visual-studio-2010 entity-framework-4 wmp

我在我的Visual Studio 2010应用程序中嵌入了WMP控件,该应用程序适用于Windows 7(Framework 4.0),但是在winXP上安装应用程序,我收到以下错误:

System.IO.FileNotFoundException: Could not load file or assembly 'Interop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Interop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at Aquila_Media_Manager.modMediaPlayer.Play_File()
   at Aquila_Media_Manager.MainForm.tsbPlay_Click(Object sender, EventArgs e) in C:\Users\Micba\Documents\Visual Studio 2010\Projects\Aquila MedMan\MainForm.vb:line 2718
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

我想这是一个参考问题,但我添加了对WMP库的引用(axinterop.wmplib.dll和interop.wmplib.dll)。 WMP适用于XP机器,但不能从我的应用程序调用。

我现在已经在网上搜索了5天并更改了参考资料,并在XP机器上重新安装了媒体播放器,但没有任何效果。

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

将构建配置更改为x86而不是AnyCPU。这将构建为32位应用程序,Interop.WMPLib将正常工作。问题是没有64位Interop WMPLib的版本,至少就我所知。