Unhandled exception running application

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
dghundt
Posts: 38
Joined: Thu 24 Aug 2006 01:16

Unhandled exception running application

Post by dghundt » Wed 20 Sep 2006 02:08

When I install my working windows application with an installer package on a different computer, I get a runtime error. I see the corelab.dll in the same folder. I dont understand why i can't install this on a client computer. I'd appreciate your help!

Could not load file or assembly 'coreLab.MySql Version=3.50.12.0, Culture=neurtral, PublicKeyToken=09af7300eec23701' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).


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

************** Exception Text **************
System.IO.FileLoadException: Could not load file or assembly 'CoreLab.MySql, Version=3.50.12.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'CoreLab.MySql, Version=3.50.12.0, Culture=neutral, PublicKeyToken=09af7300eec23701'
at Reminder_Call1.ConnectMysql.MysqlPhpSettingsRead(String& nocallafter, String& nocallbefore, String& startcallstime, String& usestartcallstime, Int32& maxretries, Int32& retrytime, Int32& waittime, Int32& callspread, String& trunk)
at Reminder_Call1.Settings.Settings_Load(Object sender, EventArgs e) in C:\Documents and Settings\David Hundt\My Documents\Microsoft Press\Visual CSharp Step By Step\Chapter 1\Reminder_Call Test CoreLab_newdb\Reminder_Call1\Settings.cs:line 381
at System.Windows.Forms.Form.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)

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



************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Reminder_Call1
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/ReminderCall1.2%20project/Reminder_Call1.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.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:





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.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 20 Sep 2006 08:03

Try to find all CoreLab.MySql.* assemblies on the client machine and remove the odd ones.

dghundt
Posts: 38
Joined: Thu 24 Aug 2006 01:16

Post by dghundt » Wed 20 Sep 2006 12:26

Thank you for your reply.
I don't understand what you mean by, "remove the odd ones".

How do I find these assemblies, where do I look for them?

I did not mention that I can install the package on the server (computer with visual studio 2005 and corelab.mysql installed) and the application runs as expected.

[email protected]
Posts: 38
Joined: Tue 07 Mar 2006 17:13

Post by [email protected] » Wed 20 Sep 2006 14:41

I'm guessing in the dark here, but I got a similar problem when I first tried installing my client app on a machine that didn't have VS 2005 and the component installed on it. Here's what I did to solve it:

Go to the publish properties and then select the "application files..." button. If the Corelab.MySql.dll says "Prerequisite (Auto)" change it to "Include". That solved my problems for me. It seems to me that VS 2005 is stupid when it comes to "Auto". By forcing it to include the component in the publish package, you force it to put the compoennt in the client Global Assembly Cache. This solved all my nasty runtime errors after the install.

If I tried installing on a machine with VS 2005 and the component installed, it alrady had the packag ein the GAC so it worked. This solved my problems on machines that didn't have the designer installed.

Hope it helps,

John ([email protected])

dghundt
Posts: 38
Joined: Thu 24 Aug 2006 01:16

Post by dghundt » Thu 21 Sep 2006 00:03

Thanks for your advice John. I am not puclishing this to the web, so I am having a hard time finding what you are recommending. Can you hold my hand a bit and tell me where to go if I am looking at my program with the solution explorer to the right side? Thanks.

Alexy, when you are able, I'd appreciate clarification for your solution as per my posting above. Thanks!

dghundt
Posts: 38
Joined: Thu 24 Aug 2006 01:16

Post by dghundt » Thu 21 Sep 2006 02:13

I was using InstallAware demo when I couldn't get it working.

I tried VisualStudio's setup project, and used the prerequisite setting you recommended. It worked! I haven't tried it the default way, but no point in that. Thanks.

I wonder why I could not get Installware to work. It is supposed to be easier and more powerful, but the cheap way worked right away.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 21 Sep 2006 07:33

Well done.
Thanks to John for his consideration.

Post Reply