Add Controller in MVC4 not working

前端 未结 11 590
一向
一向 2020-11-30 08:58

I\'m using VS 2010 Premium. I have a MVC4 project using SqlCe 4.0 with a entity framework model.

Model is:

  public class ProjectBuild
    {
       p         


        
11条回答
  •  悲哀的现实
    2020-11-30 09:27

    Ok, this is my evil solution to the problem. I finally made it work. Win8 VS2012 EF5 MVC4

    • Make sure you have the Nuget package EntityFramework.SqlServerCompact installed
    • At first, do not add the DbContext manually. Instead, use the from the scaffolding menu
    • When you have created one Controller+Views using scaffolding, switch back to your old connectionstring in the web.config - the one using SQL CE 4.0. Then everything works fine for me

提交回复
热议问题