locked
Could not load type 'AxWMPLib.AxWindowsMediaPlayer from assembly RRS feed

  • Question

  • I added a Windows Media Player control to my forum in Visual Studio and it worked fine when I ran it. However, I try running my application on another computer. I already install .NET Framwork 4 and Visual Basic Powerpack on it but I still keep getting that same message:

    An error occured creating the form. See Exception.innerExeption for details. The error is: Could not load type 'AxWMPLin.AxWindowsMediaPlayer' from assembly 'AxInterop.WMPLib, Version= 9.0.0,3095, Culture=neutral, PublicKeyToken= null'

     

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.InvalidOperationException: An error occurred creating the form. See Exception.InnerException for details.  The error is: Could not load type 'AxWMPLib.AxWindowsMediaPlayer' from assembly 'AxInterop.WMPLib, Version=9.0.0.3095, Culture=neutral, PublicKeyToken=null'. ---> System.TypeLoadException: Could not load type 'AxWMPLib.AxWindowsMediaPlayer' from assembly 'AxInterop.WMPLib, Version=9.0.0.3095, Culture=neutral, PublicKeyToken=null'.
       at TheStupidTest.Form33.InitializeComponent()
       at TheStupidTest.Form33..ctor()
       --- End of inner exception stack trace ---
       at TheStupidTest.My.MyProject.MyForms.Create__Instance__[T](T Instance)
       at TheStupidTest.My.MyProject.MyForms.get_Form33()
       at TheStupidTest.Form32.Button1_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.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)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    TheStupidTest
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Documents%20and%20Settings/public/Desktop/TheStupidTest.exe
    ----------------------------------------
    Microsoft.VisualBasic
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Runtime.Remoting
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
    ----------------------------------------
    AxInterop.WMPLib
        Assembly Version: 9.0.0.3095
        Win32 Version: 9.0.0.3095
        CodeBase: file:///C:/Documents%20and%20Settings/public/Desktop/AxInterop.WMPLib.DLL
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.

     

    • Moved by edhickey Monday, August 15, 2011 2:49 PM (From:.NET 4: Windows Workflow Foundation)
    Friday, August 12, 2011 8:52 PM

All replies

  • it might be that the WMP version on the two machines is different, this way, the interop DLL is generated using a COM object that exist for the WMP installed on your machine, BUT, might not exist with the WMP version installed on the other machine, to verify this assumption U can check for exitance of the Guid attribute associated with your interop class ( not interface ) on the other  machine ( using regedit ).

    such things R likely to happen if U compile on Win7 and test on win XP

     

     


    Nadav Rubinstein, See my Blog @ http://www.sophin.com

     


    Thursday, August 18, 2011 8:00 AM