Click here to Skip to main content
16,018,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have done an integration of a secondary monitor to a point of sale system which is having a background video playing part as well. The video is running properly in some machines. But, for few machines its not working at all. It's throwing the below error.

C#
2015-11-30 16:39:51,811 [1] FATAL - An error has occurred in the system.
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 ......PosApp.UI.Windows.WindowsMediaPlayerForm.InitializeComponent()
   at ......PosApp.UI.Windows.WindowsMediaPlayerForm..ctor()
   at ......PosApp.UI.Windows.LogOnForm.LogOnForm_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at ......PosApp.UI.Windows.WindowsForm`2.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.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)

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\....\..... POS\......PosApp.UI.Windows.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = MYPC\MyUser
LOG: DisplayName = Interop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/.../..... POS/
LOG: Initial PrivatePath = NULL
Calling assembly : AxInterop.WMPLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\....\..... POS\......PosApp.UI.Windows.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/..../..... POS/Interop.WMPLib.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/..../..... POS/Interop.WMPLib/Interop.WMPLib.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/..../..... POS/Interop.WMPLib.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/..../..... POS/Interop.WMPLib/Interop.WMPLib.EXE.

2015-11-30 16:40:11,715 [1] FATAL - An error has occurred in the system.
System.NullReferenceException: Object reference not set to an instance of an object.
   at ......PosApp.UI.Windows.LogOnForm.CancelActionButton_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)



I tried the following to fix this, but still I'm getting this error.

First, I copied the AxInterop.WMPLib.dll to the GAC folder.
Then checked the dotNet version and updated all the machines with the same version.
Then I went through several websites to find a solution for this issue. Still, I couldn't sort it out. I've spent more than two days to find a solution.


Did anyone came across this issue? Any solutions for this? Help me on this.

Thanks in advance.
Posted

1 solution

I would have thought you've covered the obvious - making sure AxInterop.WMPLib.dll is in the correct path (or the GAC as you have said)

so, have you thought about creating an MSI installer package and properly packing up 'all the dependencies' from your deployment machine to your prod machine(s) ? (you dont say how you are deploying your app, trust me, Ive been there, deploying 'bits & pieces' manually is a mugs game)
 
Share this answer
 
Comments
Krishnananthan Vijayaretnam 8-Jul-16 6:27am    
I've found the issue. Actually the issue was the dll file version is different. I've copied the dll from the working machine and replaced it to the other machine. Now, its working in both machines.

Thanks for you suggestion and time.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900