开发者

Is VS2010 downgrading the published Manifest reference to the last supported version of the MySQL Connector control (6.3.7)?

开发者 https://www.devze.com 2023-04-13 07:10 出处:网络
I have performed all the diffrent tweeks I can find, but I still get Could not load file or assembly \'MySql.Data, Version=6.3.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d\' or one of its dep

I have performed all the diffrent tweeks I can find, but I still get Could not load file or assembly 'MySql.Data, Version=6.3.7.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)

I have two Databases one for Microsoft which gets accessed first and one for my data. When I go to mine it fails. here is what I have in my web.Config with user and passwords removed

`<configuration>
  <configSections>
    <section name="DbProviderFactories"
             type="System.Configuration.SingleTagSectionHandler" />
  </configSections>

  <DbProviderFactories>
    <remove invariant="MySql.Data.MySqlClient" />
    <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL"
           type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
           applicationName="/" connectionStringName="p10009307_cusConnectionString2" writeExceptionsToEventLog="True"/>
  </DbProviderFactories>

  <runtime>
    <assemblyBinding            >
      <dependentAssembly>
        <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" />
        <bindingRedirect oldVersion="0.0.0.0-6.3.7.0" newVersion="6.4.4.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <connectionStrings>
    <remove name="LocalMySqlServer" />
    <add name="LocalMySqlServer" connectionString="server=localhost;password=210Edgepl;User Id=p1000_SECURE;logging=True;database=p10009307_sec"
      providerName="MySql.Data.MySqlClient" />
    <add name="'LocalSqlServer" connectionString="server=localhost;database=p10009307_CUS;logging=True;password=210Edgepl;User Id=p1000_MASTER"
      providerName="MySql.Data.MySqlClient" />
    <remove name="LocalSqlServer"/>
    <add name="p10009307_cusConnectionString" connectionString="server=localhost;User Id=p1000_MASTER;password=210Edgepl;database=p10009307_CUS"
      providerName="MySql.Data.MySqlClient" />
    <add name="p10009307_cusConnectionString2" connectionString="server=localhost;User Id=p1000_MASTER;password=210Edgepl;database=p10009307_CUS;sql server mode=True"
      providerName="MySql.Data.MySqlClient" />
  </connectionStrings>
  <system.web>
    <customErrors mode="Off"/>
    <authorization>
      <allow roles="Admin" />
    </authorization>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
    </authentication> 
    <sessionState mode="Custom" cookieless="true" regenerateExpiredSessionId="true" customProvider="MySqlSessionStateProvider">
      <providers>
        <add name="MySqlSessionStateProvider" type="MySql.Web.SessionState.MySqlSessionStateStore, MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="/" description="State Provider" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="True" autogenerateschema="True"/>
      </providers>
    </sessionState>
    <profile defaultProvider="MySQLProfileProvider">
      <providers>
        <clear/>
        <remove name="MySQLProfileProvider"/>
        <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="/" description="Profile provider" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="False" autogenerateschema="True"/>
      </providers>
    </profile>
    <roleManager enabled="true" defaultProvider="MySQLRoleProvider">
      <providers>
        <clear/>
        <remove name="MySQLRoleProvider" />
        <add applicationName="/" description="Role Provider" connectionStringName="LocalMySqlServer"
          writeExceptionsToEventLog="True" autogenerateschema="True" name="MySQLRoleProvider"
          type="MySql.Web.Security.MySQLRoleProvide开发者_如何转开发r, MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
      </providers>
    </roleManager>
    <membership defaultProvider="MySQLMembershipProvider">
      <providers>
        <clear/>
        <remove name="MySQLMembershipProvider"/>
        <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="/" description="Membership Provider" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="True" autogenerateschema="True" enablePasswordRetrieval="False" enablePasswordReset="True" requiresQuestionAndAnswer="False" requiresUniqueEmail="False" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
      </providers>
    </membership>

    <compilation debug="true"/>
  </system.web>
 `  

I am truely at at a loss we are thinking that what is happening is VS2010 is actually downgrading the published Manifest reference to the last supported version of the control (6.3.7). Not sure if that is by tie back reference to MySQL, or something embedded in the IDE. But it is Visual Studio that is introducing the 6.3.7 reference on the web site that is causing all the headaches.

So it looks like maybe I have to remove all the references to 6.4.4.0?


I in fact had this same exact problem... Your web.config is different looking than mine though... It was acting the same very way... Make sure the references have the right version number listed under the reference section in vs... After that the only thing it can be is the web.config... This web config is mine and it is what fixed the issue with it trying to use a older version of mysql.data ...

<?xml version="1.0" encoding="utf-8"?>
<!--
     For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=152368
     -->
    <configuration>
    <connectionStrings>
    <add name="ApplicationServices" connectionString="Data Source=tcp:xxxxxxxx;InitialCatalog=xxxxxxxxxxxx;User ID=xxxxxxxxxxxxxx;Password=xxxxxxxx;Integrated Security=False;" />
    <add name="xxxxxxxxxxxx_schoolEntities" connectionString="metadata=res://*/Models.School.csdl|res://*/Models.School.ssdl|res://*/Models.School.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=xxxxxxxxxxxx;User Id=xxxxxxxxxx;password=xxxxxxxxxx;Persist Security Info=True;database=xxxxxxxxxxxxx_school&quot;" providerName="System.Data.EntityClient" />
    </connectionStrings>
    <appSettings>
    <add key="loginUrl" value="~/Account/LogOn" />
<add key="webpages:Version" value="1.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="PayPalMerchantEmail" value="xxxxxxxxxxx@gmail.com" />
</appSettings>
<system.data>
<DbProviderFactories>
  <add name="MySQL Data Provider" invariant="MySQL.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySQL.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<system.web>
<trust level="Full" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
    <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add assembly="MySql.Data, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
  </assemblies>
  </compilation>
  <authentication mode="Forms">
  <forms loginUrl="~/Account/LogOn" timeout="10000" />
  </authentication>
  <membership>
  <providers>
    <clear />
    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
  </providers>
  </membership>
  <profile>
  <providers>
    <clear />
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
  </providers>
  </profile>
  <roleManager enabled="true">
  <providers>
    <clear />
    <add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
    <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
  </providers>
  </roleManager>
  <pages>
  <namespaces>
    <add namespace="System.Web.Helpers" />
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Routing" />
    <add namespace="System.Web.WebPages" />
  </namespaces>
  </pages>
  </system.web>
  <system.webServer>
  <validation validateIntegratedModeConfiguration="false" />
  <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
  <runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" />
    <bindingRedirect oldVersion="0.0.0.0-6.3.6.0" newVersion="6.4.4.0" />
  </dependentAssembly>
  </assemblyBinding>
  </runtime>
  </configuration>

This is the only thing I could think of...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号