简体   繁体   中英

assembly reference MySql.Data in web.config not working

I'm trying to put an ASP page on my website that accesses a MySql database. The Website project was built in VS2015 and I used MySql.Data dll version 8.0.11.0 (the latest release).

I hosted the website on localhost on the development machine with IIS server. The web.config file has the following assembly reference which was created by VS -

<compilation debug="true" targetFramework="4.0">    
  <assemblies>           
    <add assembly="MySql.Data, Version=8.0.11.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>       
  </assemblies>     
</compilation>

Everything works fine on the development machine, I can access the database, execute queries, etc.

The problem comes when I upload everything to the hosting server. The assembly reference above causes the following error from the parser - Parser Error Message:

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

I'm thinking that the host server may not have this latest version. Could this be the problem, and if so, how should I reference the MySql.Data assembly?

I have looked all over the web, but cannot find anything very specific, would greatly appreciate any help.

建议的修复方法是将MySQL.Data dll粘贴到bin文件夹中

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM