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.
Jan 13, 2011 @ 20:27:37
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. :-)
Mar 15, 2011 @ 05:12:09
i have the same problem providerincompatibleexception ,how do you solve this ?
i followed your example but what if you already have a database ?
Mar 16, 2011 @ 17:54:25
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
Apr 15, 2011 @ 19:38:32
I’m run this application (http://msdn.microsoft.com/en-us/data/gg685467) but I had the same problem.
What is actually?
Apr 15, 2011 @ 19:57:48
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.
Apr 17, 2011 @ 13:39:14
Hi,
I modified web.config but same error occured.
May 11, 2011 @ 23:03:57
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.
Oct 04, 2011 @ 12:49:35
this helped me a lot… thanks a million.
Nov 09, 2011 @ 09:50:10
thanks! your solution works like a charm! :-)
Nov 16, 2011 @ 18:35:33
It worked like a charm! Thanks a lot!
Jan 04, 2013 @ 12:51:10
it took my 2 hours trying to find how to solve my problem until i found your blog. thanks a lot
Mar 06, 2013 @ 22:02:17
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!
Apr 26, 2013 @ 01:20:10
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