A ProviderManifestToken string error was not returned by the provider.

asp.net-mvc-3 dbcontext entity-framework mysql


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.

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


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

5/23/2017 11:45:52 AM

Accepted Answer

The problem was with the MySQL connector/Net.

I previously used MySQL connector/Net 6.3.5 and after I uninstalled it and installed MySQL connector/Net 6.5.4 the issue was fixed. You can find latest connectors at http://www.mysql.com/products/connector/

4/23/2012 11:12:17 PM

Popular Answer

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.

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow