Unable to Retrieve Metadata

后端 未结 6 2197
傲寒
傲寒 2020-11-29 10:01

MVC4 + Entity Framework 4.4 + MySql + POCO/Code First

I\'m setting up the above configuration .. here are my classes:

namespace BTD.         


        
6条回答
  •  野性不改
    2020-11-29 11:00

    I've been having the same problem using EF 4.3.1 and MySql Connecter/Net 6.6.4.0

    This worked for me, no need to connect to a different db or extra code in the Context class.

    Add this between the entityFramework tags in your web.config file when you want to build a scaffold:

    
      
        
      
    
    

    Then comment the above code out when you want to run migrations and vice versa.

    So you web.config will look like so:

    
      
        
          
        
      
      
    
    

    This is quite ridiculous how .NET developers have to jump through some arduous hoops in order to get their code working.

    Working example

    https://github.com/dublinan/mvc-mysql-ef-example

    Links to my github project

提交回复
热议问题