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

前端 未结 11 1517
慢半拍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:40

    mine got fixed like this:

        public virtual DbSet Categories { get; set; }
    
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            //--> EntityTypeConfiguration
            modelBuilder.Configurations.Add(new EntityTypeConfiguration());  
    
            base.OnModelCreating(modelBuilder);
        }
    

    DOn't forget Ctrl + Shift + B so your code compile (i'm not sure for single solution, but since mine is in another project in same solution, it should get compiled first)

提交回复
热议问题