Entity Framework Scaffolding: The type is not mapped issue

This was a tricky one. I was just watching Scott Hanselmans session from MIX 11 “Microsofts Web Stack Of Love” and as always the guys it totally brilliant. It’s like stand up mixed with development. Anyway, he talked a bit about MVC Scaffolding and about how awesome it was. I fired up Visual Studio and installed MVCScaffolding via NuGet added some EF Models and boom! This was what i saw.

The type was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit from EntityObject.

Hmm, that was not what i expected. Turns out that i had not installed Entity Framework 4.1 completely. I found this post and i had the exact same problem. Just download Entity Framework from here and everything should work as excpected. Now back to the session!

3 Thoughts on “Entity Framework Scaffolding: The type is not mapped issue

  1. hi thanks for post

    I’ve just installed visual studio 2010 (SP1) and MVC3 + installed Entity framework from offered link in this post but still getting below error when trying to add new controller from VS or using generated model from EDMX. it seems EntityObject is not missing and project is compiled successfully.

    i weren’t able to track this issue thanks for help .

    Unable to retrirve metadata for ‘X’. The type ‘X’ was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit from EntityObject.

Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Post Navigation