DharmeshPatel33 / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Problem when using a different version of MySql.Data.dll (Comparing the assembly name resulted in the mismatch: Minor Version) #269

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use MySql.Data.dll (from Connector/Net) version 6.4.4.0 instead of 6.1.3.0.
2. Set it up for MySql error logging..
3. Go to http://project/elmah.axd

What is the expected output? What do you see instead?
I expect elmah to work as normal with mysql as storage to persist error logs. 
But this is what I get: Could not load file or assembly 'MySql.Data, 
Version=6.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of 
its dependencies. The located assembly's manifest definition does not match the 
assembly reference. (Exception from HRESULT: 0x80131040) (See additional error 
messages below)

What version of the product are you using? On what operating system?
MySql connector version 6.4.4.0
Windows 7/2008

Please provide any additional information below.
My project used to use 6.1.3.0 but now uses Mysql.web.dll and mysql.data.dll 
from mysql connector/net version 6.4.4.0. All instances of "... MySql.Web, 
Version=6.1.3.0.. " has been changed to 6.4.4.0 in web.config.

System.Web.HttpUnhandledException: Exception of type 
'System.Web.HttpUnhandledException' was thrown. ---> 
System.IO.FileLoadException: Could not load file or assembly 'MySql.Data, 
Version=6.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of 
its dependencies. The located assembly's manifest definition does not match the 
assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'MySql.Data, Version=6.1.3.0, Culture=neutral, 
PublicKeyToken=c5687fc88969c44d'
   at Elmah.MySqlErrorLog.GetErrors(Int32 pageIndex, Int32 pageSize, IList errorEntryList)
   at Elmah.ErrorLogPage.OnLoad(EventArgs e) in c:\builds\ELMAH\src\Elmah\ErrorLogPage.cs:line 76
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

=== Pre-bind state information ===
LOG: User = MYCOMPUTER\Andy
LOG: DisplayName = MySql.Data, Version=6.1.3.0, Culture=neutral, 
PublicKeyToken=c5687fc88969c44d
 (Fully-specified)
LOG: Appbase = file:///localpath/to/project/
LOG: Initial PrivatePath = localpath\to\project\bin
Calling assembly : Elmah, Version=1.2.14318.0, Culture=neutral, 
PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: localpath\to\project\web.config
LOG: Using machine configuration file from 
C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: MySql.Data, Version=6.1.3.0, Culture=neutral, 
PublicKeyToken=c5687fc88969c44d
LOG: Attempting download of new URL file:///Local/Temp/Temporary ASP.NET 
Files/project/4e6193f2/5fe5d466/MySql.Data.DLL.
LOG: Attempting download of new URL file:///Local/Temp/Temporary ASP.NET 
Files/project/4e6193f2/5fe5d466/MySql.Data/MySql.Data.DLL.
LOG: Attempting download of new URL 
file:///localpath/to/project/bin/MySql.Data.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

   --- End of inner exception stack trace ---
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Original issue reported on code.google.com by andyrefu...@gmail.com on 13 Jan 2012 at 3:04

GoogleCodeExporter commented 9 years ago
Error occurs with other versions of MySql.Data.dll as well. I received this 
using version 6.4.3.0

Original comment by m...@mynameiskristopher.com on 13 Mar 2012 at 9:28

GoogleCodeExporter commented 9 years ago
Downloading source and referencing newer version of MySql.Data.dll and then 
recompiling Elmah for a private build appears to resolve this problem.

Original comment by m...@mynameiskristopher.com on 15 Mar 2012 at 1:33

GoogleCodeExporter commented 9 years ago
Does adding this to your web.config solve the issue?

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral"/>
        <bindingRedirect oldVersion="6.1.3.0" newVersion="6.4.4.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Original comment by jamesdriscoll71 on 15 Mar 2012 at 2:11

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 15 Mar 2012 at 6:22

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 23 Mar 2012 at 10:59

GoogleCodeExporter commented 9 years ago
Sorry for not getting back with the solution. And yes, comment #3 solved the 
problem and is more practical than recompiling from source.

Thanks and more power! :)

Original comment by andyrefu...@gmail.com on 26 Mar 2012 at 4:27

GoogleCodeExporter commented 9 years ago
Thanks for reporting back. No further action needed as the binding redirection 
provision in the runtime is the correct solution to such issues.

Original comment by azizatif on 26 Mar 2012 at 8:31