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=184.108.40.206′” 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…
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'MySql.Web.v20, Version=220.127.116.11, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
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 :
- Start the installer and click “Change” then remove the “Web Providers” section entirely.This will remove the declarations from your machine.config. You can find the path to machine.config below:1234567891011<strong>32-bit</strong>%windir%Microsoft.NETFramework[version]configmachine.config<strong>64-bit</strong>%windir%Microsoft.NETFramework64[version]configmachine.configwhere [version] should equal v1.0.3705, v1.1.4322, v2.0.50727 or v4.0.30319.v3.0 and v3.5 just contain additional assemblies so there should be no configmachine.config
- 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.