Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The provider did not return a ProviderManifestToken string error

I am trying to create a web app using ASP.Net MVC3, Entity Framework and MySQL.

I have added the following code to my Web.Config file.

<connectionStrings>
    <add name="ContactContext" connectionString="server=localhost;database=contacts;uid=root;pwd=password;" providerName="MySql.Data.MySqlClient"/>

  </connectionStrings>

I also have created "Person" Model , "ContactContext" in the project "Contact_Me". When I try to create a "ContactController" including Person Model and Contact context, it gives me the following error

"Unable to retrieve metadata for "Connect_Me.Models.Persons". The provider did not return a ProviderManifestToken string"

MYSQ & MVC3 SQL connection error \ ProviderManifestToken but I am using MySQL, this is the closest question to mine. But the answer didn't solve my problem.

Thanks in advance

like image 213
har Avatar asked Apr 22 '12 16:04

har


3 Answers

I know this may be very basic for a couple of you guys, but this exception is also thrown in cases where EF is unable to locate a Connection String to use. If you-re working in a multi-layered application, make sure the connection String is added to your client application, instead of the class library that contains you data access code. Just my 2 cents.

like image 89
user1843594 Avatar answered Nov 02 '22 06:11

user1843594


I got this error when my sql server was actually down. So, please be sure that your sql server is up and running.

like image 10
erdal Avatar answered Nov 02 '22 05:11

erdal


You can also get this error if you upgrade Nuget references in an EntityFramework project that uses MySql.Data.Entity (latest version is 6.10.X) and MySql.Data (latest version is 8.0.X). Those version numbers should match. You should use the MySql.Data.EntityFramework package with MySql.Data version 8.0 and after, and the MySql.Data.Entity package with versions 6.10 and before.

There are a lot more details in this blog post: https://davidsekar.com/asp-net/mysql-error-the-provider-did-not-return-a-providermanifesttoken

like image 5
Tim Cooke Avatar answered Nov 02 '22 06:11

Tim Cooke