MVC Scaffolding Does Not Support Entity Framework 6

I am trying to add a controller with read / write actions and views using the Entity Framework.

But when I try to do this, VS2012 tells me that "MVC scaffolds do not support Entity Framework 6 or later." I read http://support.microsoft.com/kb/2816241 and tried to remove EntityFramework 6 and install 5 in the Nuget Manager console:

PM> Remove EntityFramework package -force Removing "EntityFramework 6.0.2" from OnlinebookingAdministrator. Removed "EntityFramework 6.0.2" from OnlinebookingAdministrator. Uninstall "EntityFramework 6.0.2". Remote uninstall "EntityFramework 6.0.2".

PM> Install-Package EntityFramework -version 5.0.0 "EntityFramework 5.0.0" is already installed. Adding "EntityFramework 5.0.0" to the OnlinebookingAdministrator. Successfully added โ€œEntityFramework 5.0.0โ€ to OnlinebookingAdministrator.

But the error appears when I try to add a controller. Is there a solution for this?

+7
asp.net-mvc entity-framework-6
source share
2 answers

I am afraid that I do not have the perfect solution to your problem, but I think I have a pretty decent solution:

I have had a lot of arguments lately with MVC Scaffold-er by default, I would recommend installing MVCScaffolding via NuGet and using the console to create everything you need.

Steps to fix:

  • Install MVCScaffolding with NuGet

    PM> Install-Package MvcScaffolding 
  • Run the following command using the package manager console, replacing ModelName with the name of the model you want to create Controllers / Views for.

     PM> Scaffold Controller ModelName 
  • Learn basic MVCScaffolding commands

    MvcScaffolding: standard use

+1
source share

Have you tried http://go.microsoft.com/fwlink/?LinkId=276833 ?

You must manually raise your sights or use Entity Framework 5 for scaffolding. After you raise your application, you can use Entity Framework 6.

Note. This article is "FAST PUBLISH", created directly from the Microsoft support organization. The information contained in this document is provided as is in response to problems. As a result of quick access to materials, materials may contain typographical errors and may be revised at any time without prior notice. See Terms of Use for other considerations.

0
source share

All Articles