0

I am trying to follow the tutorial on the building my first MVC application for here all was good until I needed to run the application an entity framework should have done it's thing and create the data base for me, but for some reason I always get the same error :

The provider did not return a ProviderManifestToken string.

my question: what are the necessary adjustments i need to do in order for the application to work?

here is my web.config file connection string section

<connectionStrings>
<add name="ApplicationServices"
     connectionString="data source=Moran-Laptop;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
     providerName="System.Data.SqlClient" />
<add name="MovieDBContext"
     connectionString="Data Source=|DataDirectory|Movies.sdf"
     providerName="System.Data.SqlServerCe.4.0"/>

Moran Monovich
  • 595
  • 1
  • 14
  • 27
  • 1
    There are several other stackoverflow threads about this error. Have you tried what they have suggested? http://stackoverflow.com/questions/5423278/ef-4-1-exception-the-provider-did-not-return-a-providermanifesttoken-string – Marc Talbot Feb 16 '12 at 14:31
  • 1
    Seems like a duplicate of: http://stackoverflow.com/questions/5423278/ef-4-1-exception-the-provider-did-not-return-a-providermanifesttoken-string – Vedran Feb 16 '12 at 14:32
  • Have you read through the comments on the linked page? there is several which mention `ProviderManifestToken ` why they had the issue and how they fixed it. I don't mean it in a smart way, just making sure none of their solutions applied to you. – Nope Feb 16 '12 at 14:33
  • I have looked for but haven't found any probably because I didn't search for the appropriate search terms. thanks for the reference. – Moran Monovich Feb 16 '12 at 14:36
  • now I got it, i think i should have installed the sql compact 4.0 and entity framework 4.3 before I'have started the application. I will start over and try again – Moran Monovich Feb 16 '12 at 14:56

3 Answers3

0

I think your data source is not correct. Does it work with:

<add name="ApplicationServices"
     connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
     providerName="System.Data.SqlClient" />
Zach Green
  • 3,421
  • 4
  • 29
  • 32
  • I have installed sql server compact 4, but now I am getting another message. seems to me like it has no end. i will find a different tutorial thanks – Moran Monovich Feb 16 '12 at 15:16
0

If you inspect the exception you will find out that there is InnerException as well which most probably points to SqlException and its inability to find the database or server. Your ConnectionString expects that you have Sql Server CE database available in your App_Data folder. The tutorial that you are looking does not yet tell you that you have to add a new SQL Server CE database to your App_Data folder. Check part 5 of the tutorial http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/getting-started-with-mvc3-part5-cs

Huske
  • 9,186
  • 2
  • 36
  • 53
0

First off you need to change your connection strings to point to the servers instance of sql server rather than to your laptop

in your connection strings replace Moran-laptop with "server-name\db name" i.e. r2008sqlserver\movies

Brian
  • 2,229
  • 17
  • 24