Can't load mysql.web assembly

2020-02-08 15:01发布

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!

9条回答
老娘就宠你
2楼-- · 2020-02-08 15:59

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

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

查看更多
Luminary・发光体
3楼-- · 2020-02-08 16:01

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.

查看更多
手持菜刀,她持情操
4楼-- · 2020-02-08 16:06

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

查看更多
登录 后发表回答