Let’s say you are developing an MVC application and you want to add a generated controller with the associated views.
You do this:
- Setting the controller’s name
- Choosing the template: mvc controller with read/write actions and views, using Entity Framework
- Choosing the model class
- Choosing the data context
- Clicking “Add”
It’s possible that you get this error:
The solution is quite simple:
Just go in the web.config file and comment the connection string
Then try again
It works!
Don’t forget to uncomment your connection string and you are done.
Incoming search terms:
- unable to retrieve metadata for model class
- MVCandEntityFramework:Unabletoretrievethemetadataforthemodel
- unable to retrieve metadata for
- unable to retrieve metadata for model
- unable to retrieve metadata for mvc
- unable to retrieve metadata
- entity framework unable to retrieve metadata
- asp net mvc unable to retrieve metadata
- mvc unable to retrieve metadata
- yhs-fullyhosted_003
Hi, thank you for this article, however when I comment out the connection string it throws a different error message cause it’s looking for the name of that context. So is there a way to get past that?