Add Controller in MVC4 not working

前端 未结 11 588
一向
一向 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:26

    I was having this problem when adding a API 2.0 / MVC5 controller with Entity Framework 6 and an MySQL database.

    [DbConfigurationType(typeof(MySqlEFConfiguration))]
    

    Comment this class attribute out. Build project. Then adding a controller works for me on MySql.

    Uncomment after controller is added and continue as normal.

提交回复
热议问题