0

Trying to use a mysql db with a mvc4 project and ran into this error.

the error is triggering at my membershipprovider in web.config

 <membership defaultProvider="MySqlMembershipProvider">
  <providers>
    <clear />
    <add name="MySqlMembershipProvider"
         type="MySql.Web.Security.MySQLMembershipProvider,
     MySql.Web, Version=6.5.4.0, PublicKeyToken=c5687fc88969c44d"
     autogenerateschema="true"
     connectionStringName="MySqlConnectionString"
     enablePasswordRetrieval="false"
     enablePasswordReset="true"
     requiresQuestionAndAnswer="false"
     requiresUniqueEmail="false"
     passwordFormat="Hashed"
     maxInvalidPasswordAttempts="5"
     minRequiredPasswordLength="6"
     minRequiredNonalphanumericCharacters="0"
     passwordAttemptWindow="10"
     passwordStrengthRegularExpression=""
     applicationName="/" />
  </providers>
</membership>

i have MySql.Data, MySql.Data.Entity and MySql.Web in my referrences, all added with nuget install-Package commands. How can it still not be found ? Does it have something to do with not installing some MySql stuff directly on my machine?

2 Answers 2

1

Install MySQl Connector and add reference of that. That was helped me.

You can find the connector for MySQL from Here

Sign up to request clarification or add additional context in comments.

4 Comments

It says that i already have a reference to MySql.web which makes sense since i got that reference when i installed the package with NuGet
have you added reference to the dll file ? and make sure the version mentioned here is the same as your referenced dll.
i had, it seems the issue wasn't missing references, but the references being to different version. I wasn't aware of this because i had gotten the references with NuGet Install-Pacakge commands
Worked for me too. Didn't even have to reload my project.
0

Turns out getting the references with NuGet got different versions.

MySql.Data and MySql.Data.Entity where of version 5.x.x.x, while MySql.web was of version 7.4.0

specifying the version, like so

Install-Package MySql.Data -Version 6.7.4

for both MySql.Data and MySql.Data.Entity made the site run without error.

installing MySql connector and referencing these 2 dll's from the 6.7.4 version also works.

Short answer, the issue originating from having different versions with these dll's, NOt because one of them were missing.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.