无法加载文件或程序集“MySql.Data,版本= 6.8.3.0"它依赖或1。该系统找不到指定的文件 [英] Could not load file or assembly 'MySql.Data, Version=6.8.3.0" or one of its dependencies. The system cannot find the file specified

查看:3392
本文介绍了无法加载文件或程序集“MySql.Data,版本= 6.8.3.0"它依赖或1。该系统找不到指定的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不断收到这个配置错误每次我尝试和上传我的网站服务器,能正常工作在本地主机上

 无法加载文件或程序集MySql.Data,版本= 6.8.3.0,文化=中性公钥= c5687fc88969c44d'或它的一个依赖。该系统找不到指定的文件。第18行:其中,编译严=false的明确=真targetFramework =4.0调试=真正的>
第19行:其中,组件>
第20行:LT;添加组件=MySql.Data,版本= 6.8.3.0,文化=中性公钥= C5687FC88969C44D/>
第21行:LT;添加组件=MySql.Web,版本= 6.8.3.0,文化=中性公钥= C5687FC88969C44D/>
第22行:LT; /组件>

我曾尝试复制的DLL来斌,但没有工作,我已经删除了引用,并在VS2013重新添加,重建项目,访问GAC,并从那里复制...但没有已经奏效。任何人有任何建议,下一步的尝试,从web配置code如下。

 <结构>
  <&运行GT;
        < assemblyBinding的xmlns =瓮:架构 - 微软COM:asm.v1>
            < dependentAssembly>
                < assemblyIdentity名称=MySql.Data公钥=c5687fc88969c44d/>
                < bindingRedirect oldVersion =0.0.0.0-6.3.7.0NEWVERSION =6.8.3.0/>
            < / dependentAssembly>
        < / assemblyBinding>
< /运行>
  <&的System.Web GT;    <的customErrors模式=关/>
    <编译严=false的明确=真targetFramework =4.0调试=真正的>
      <&集会GT;
        <添加组件=MySql.Data,版本= 6.8.3.0,文化=中性公钥= C5687FC88969C44D/>
        <添加组件=MySql.Web,版本= 6.8.3.0,文化=中性公钥= C5687FC88969C44D/>
      < /组件>
    < /编译>
    <的httpRuntime />
  < /system.web>
  <&System.Data这GT;
  < D​​bProviderFactories>
    <添加名称=MySQL的数据提供程序
         不变=MySql.Data.MySqlClient
         说明=用于MySQL的.NET Framework数据提供程序
         键入=MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data公钥= c5687fc88969c44d/>
  < / DbProviderFactories>
< /system.data>
  <&是connectionStrings GT;
    <添加名称=MainConnectionString的connectionString =服务器= XXXXXXX;初始目录=主;坚持安全信息= TRUE; UID = XXXXX;密码= XXXXXXX的providerName =System.Data.SqlClient的/>
  < /&是connectionStrings GT;
    < /结构>


解决方案

不知道这是否会帮助你,但我只是有类似的问题。
在Solution Explorer中右键单击mysql.data.dll,选择包括项目后,它可以在我的网络服务器...(当然再版后)

I keep getting this Config error everytime I try and upload my website to the server, works fine on localhost

 Could not load file or assembly 'MySql.Data, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.

Line 18:   <compilation strict="false" explicit="true" targetFramework="4.0" debug="true">
Line 19:       <assemblies>
Line 20:         <add assembly="MySql.Data, Version=6.8.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
Line 21:         <add assembly="MySql.Web, Version=6.8.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
Line 22:       </assemblies>

I have tried copying the dll's to bin but that didn't work, i've deleted the references and readded in VS2013, rebuilt the project, access the GAC and copied from there...but none of that has worked. Anyone got any suggestions as to what to try next, code from web config is below.

<configuration>
  <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" />
                <bindingRedirect oldVersion="0.0.0.0-6.3.7.0" newVersion="6.8.3.0" />
            </dependentAssembly>
        </assemblyBinding>
</runtime>
  <system.web>

    <customErrors mode="Off"/>
    <compilation strict="false" explicit="true" targetFramework="4.0" debug="true">
      <assemblies>
        <add assembly="MySql.Data, Version=6.8.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
        <add assembly="MySql.Web, Version=6.8.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
      </assemblies>
    </compilation>
    <httpRuntime/>
  </system.web>
  <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, PublicKeyToken=c5687fc88969c44d" />
  </DbProviderFactories>
</system.data>
  <connectionStrings>
    <add name="MainConnectionString" connectionString="Server=xxxxxxx;Initial Catalog=Main;Persist Security Info=True;UID=xxxxx;Password=xxxxxxx" providerName="System.Data.SqlClient"/>
  </connectionStrings>
    </configuration>

解决方案

Not sure if it will help you but I just had a similar problem. After right clicking in the solution Explorer on the mysql.data.dll and select "include in project" it Works on my webserver... (After republishing of course)

这篇关于无法加载文件或程序集“MySql.Data,版本= 6.8.3.0&QUOT;它依赖或1。该系统找不到指定的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆