Showing posts with label MVC. Show all posts
Showing posts with label MVC. Show all posts

Wednesday, May 1, 2013

Error when add the StoreManagerController on MVC Music Store Tutorial Part 5

When I followed the MVC Music Store Tutorial using Microsoft Visual Studio Express 2012 for Web on Windows 8, I got this error:

Unable to retrieve metadata for 'MusicStore.Models.Album'. Using the same DbCompiledModel to create context against different types of database servers is not supported. Instead, create a separate DbCompiledModel for each type of server being used.

No idea. Let google for a solution. Here a solution from ITorian (http://www.itorian.com/2012/10/unable-to-retrieve-metadata-for.html) :

After I delete this line in web.config, it worked: 

     connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf"
     providerName="System.Data.SqlServerCe.4.0"/>

Thank the author of ITorian.com.