Can’t load mysql.web assembly

I am making a web application with ASP.net MVC3. I eventually want to use roleprovider and authentication used by a login form. So I have this code:

<authentication mode="Forms">
  <forms loginUrl="~/Home/Login" timeout="2880" />
</authentication>

<roleManager enabled="true" defaultProvider="MyRoleProvider">
  <providers>
    <add name="MyRoleProvider"
         type="StudentAdministratieProject.Authorisation.CustomRoleProvider"/>
  </providers>
</roleManager>

This code is obviously located in my web.config.

The error I get when I start the application:

Can’t load file or assembly MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d or one of the dependencies can’t be loaded. The system cannot find the given file. ** Note that this is roughly translated from Dutch, the error was originally in Dutch.

Any ideas? Ive Googled a lot but can’t find anything which helped me!

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

realize this is old, but in case its viewed later, here’s what I found is cause / resolution.

I had to do some MySQL work on my regular .NET web server (db and web servers on same machine) so I used the MySQL installer (http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html). That little sucker seems to have gone and updated my .NET machine.config for me, how nice, so it’s connector will work well with .NET. Stupid installer. Anyways when I went to go use a .NET / SQL Server app (no tie in to MySQL) I got the same error.

Easy enough fix (and your MySQL utilizing apps should still work just fine). Just comment out the MySQL reference(s) in the appropriate .NET framwework machine.config.

NOTE: the web page the error is on will tell you what machine.config file (and line number) is offending.

Link below is more detailed:

http://forums.asp.net/t/1928379.aspx

Method 2

My Solution to this question as I do had the same issue:

Just add a reference to MySql.Web and it will go.

Method 3

Try reinstalling MySQL .NET Connector 6.9.4 while uncheck “Web Providers” during the installation –

See more at: [ASP.NET with MySQL: Configuration Error (MySql.Web.v20)][1] http://technowide.net/2014/11/07/asp-net-with-mysql-configuration-error/

Method 4

I have experienced the same situation and managed to fix the problem with these steps,

  1. Read the error information carefully which provides helpful details to rectify the situation.
  2. I wouldn’t change the machine.config file.
  3. As it says Application cannot find a reference to the assembly MySql.Web and the version it is trying to reference is Version=6.7.4.0.
  4. Based on path you install MySql you will be able to find the correct assembly files, ex : C:Program FilesMySQLConnector NET 6.7.4Assembliesv4.0MySql.Web.dll
  5. Copy C:Program FilesMySQLConnector NET 6.7.4Assembliesv4.0MySql.Web.dll file to bin folder. (I would copy all the files in C:Program FilesMySQLConnector NET 6.7.4Assembliesv4.0 folder to bin folder)

Hope this helps!
Thanks

Method 5

Another solution:

  • check version of .NET used by application pool of your web application. here we consider version is 2.0
  • go to folder C:Program Files (x86)MySQLConnector NET 6.7.4Assembliesv2.0 (<- depend of your version)
  • copy dll from previous folder to C:Windowsassembly

Method 6

I managed to resolve this by running MySQL Installer and updating to the latest files available.

Method 7

As Beginner to .NET, i also experienced the same situation..

But it can be resolved very simple step.

Select references from solution explorer . Right click on it, Select Add reference, select mysql.web from the list of assemblies, then add it.

After adding mysql.web assembly , you can get rid out from this error.

Thanks!!

Method 8

I have been looking for answer and I find the solution that work for me on fix-for-mysql-connectornet-693

You just need to delete “.v20” from every instance of MySql.Web.v20 in

C:WindowsMicrosoft.NETFrameworkv4.0.30319Configmachine.config

and
C:WindowsMicrosoft.NETFramework64v4.0.30319Configmachine.config

You can edit files in Notepad (Run As Administrator!).

Method 9

For upgrading latest version and solving these kind of issues;

Under Nuget Manager Console run

PM> Install-Package MySql.Web

this will download latest MySql.Web for you. From project references find dll version by looking its properties.

Then,change any other version in your web.config with this new version. This works.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x