Entity Framework - Expecting non-empty string for 'providerInvariantName' parameter

前端 未结 2 1694
说谎
说谎 2021-02-07 07:18

Ok, this may not be related to EF. I am trying to use the code-first feature and following is what I wrote:-

var modelBuilder = new ModelBuilder();
            v         


        
2条回答
  •  礼貌的吻别
    2021-02-07 08:16

    I had the same error when I uploaded my website to the production server. My connection string had the providerName property set. The cuase of the problem was a connection string in machine.config named LocalSqlServer and a role provider that has used that connection string:

    
       
       
       ....
    

    So all I had to do was clearing connection strings and role providers before registering mine:

      
        
        
      
      ...
      
        
          
          
        
      
    

提交回复
热议问题