ASP.NET with MySQL: Configuration Error (MySql.Web.v20)

Recently got stucked on an issue while using MySQL db with a ASP.NET project and ran into configuration error “Parser Error Message: Could not load file or assembly ‘MySql.Web.v20, Version=6.9.4.0′” despite the fact that MySql.Data, MySql.Data.Entity and MySql.Web in my referrences, all added with nuget install-Package commands. That got me really frustrating…

This issue occurs when you install MySQL .NET Connector 6.9.4 (probably other versions too) and did not uncheck “Web Providers” during the installation; it writes in your machine.config which brings you to this error.

To solve the problem properly, follow below steps :

  1. Start the installer and click “Change” then remove the “Web Providers” section entirely.MySqlConfigThis will remove the declarations from your machine.config. You can find the path to machine.config below:
  2. When your machine config is clear add the MySql.Web assembly to your project and add the MySQLMembershipProvider declaration in your project web.config using the standard procedure.

You can find the connector for MySQL from here.

Enjoy!!

  • Anuj Khanna

    Good article!

  • krishan

    good, keep it up.

  • Don Sagrott

    Ran into this same problem with some asp.net projects after a new install of MySQL on my dev machine. Changed the settings as per your recommended steps and it solved the problem.
    *Note for those on win 8 or > the MySql dialogs are a little different in appearance but these same settings are there.
    Thanks very much for posting!