Scaffolding controller doesn't work with visual studio 2013 update 3 and 4

前端 未结 11 1508
慢半拍i
慢半拍i 2020-12-23 19:53

Im unable to scaffold a controller (MVC5 Controller with views, using Entity Framework) in Visual studio 2013 (update 3 and 4). The error message is below:

There was

11条回答
  •  一向
    一向 (楼主)
    2020-12-23 20:24

    Here is how I resolved this issue. I have Visual Studio 2013 Update 4.
    I use EF Power Tools. Comment out all of the DbSet < ... > Inside OnModelCreating, only leave the object you are scaffolding: modelBuilder.Configurations.Add(new SomeTableDataMap());

    At the bottom of my context class I did notice this got created: public System.Data.Entity.DbSet SomeTableDatas{ get; set; }

    Oh: I also put this in my constructor but it's for something else, this.Configuration.LazyLoadingEnabled = false;

    Seriously, this worked today, I've tried all of these solutions nothing worked for Update 4. I had this working in Update 2 and Update 3 using previous solutions. This is the most up-to-date solution for now.

提交回复
热议问题