Message=The provider did not return a ProviderManifestToken string.
Or, how to run EF code-first without SQL Express.
I got the above exception being thrown when I started playing around with Entity Framework’s Code-First CTP5. The inner exception revealed the true problem:
The problem is that by default EF Code-First tries to create your database on a SQL Express instance.
I don’t run SQL Express, I run SQL Server Developer edition. The solution is to add a connection string for the code-first database to your web.config (even though this database doesn’t yet exist):
<connectionStrings> <add name="TweetContext" connectionString="Data Source=.; Initial Catalog=Tweet; Integrated Security=SSPI;" providerName="System.Data.SqlClient" /> </connectionStrings>
Note that the name (TweetContext) must match the name of your class which derives from DbContext, i.e.
public class TweetContext : DbContext
And you have to specify the DB name, i.e Initial Catalog=Tweet, but that database should not already exist, as EF code-first will create it for you.
I had the same problem in a test project which required me to change App.config instead of web.config. I just write this in case someone in my same situation runs across your blog entry. :-)
i have the same problem providerincompatibleexception ,how do you solve this ?
i followed your example but what if you already have a database ?
EF Code first with an existing database:
http://weblogs.asp.net/scottgu/archive/2010/08/03/using-ef-code-first-with-an-existing-database.aspx
I’m run this application (http://msdn.microsoft.com/en-us/data/gg685467) but I had the same problem.
What is actually?
What it is, is that you don’t have SQL Server Express installed and that is where EF Code first expects to find your server – at .\sqlexpress. I think that is what throws this exception. You need to modify your web.config as I explained.
Hi,
I modified web.config but same error occured.
You are a god! I scoured the web for this fix. I really am liking this Code-First approach and I did not want to revert to SQL Express.
this helped me a lot… thanks a million.
thanks! your solution works like a charm! :-)
It worked like a charm! Thanks a lot!
it took my 2 hours trying to find how to solve my problem until i found your blog. thanks a lot
You can also run into this issue when you are deploying and have:
– A SQL server that is not accessible
– An invalid username or password (or other credential) in the connection string
I ran into these and figured I should share the other two reasons I’ve seen it. Thanks for the pointer in the right direction!
For me the MSDTC was not configured for transactions. refer to this link on how to set it up.
http://www.packtpub.com/article/how-configure-msdtc-firewall-distributed-wcf-service
Well, You not only saved my frustrations and hours. But gave me a hope that MVC, and learning new skills never sucks.
Cheers for this, it saved me a lot of time.
Thank you VERY much!!!!!!!