The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception

前端 未结 26 1172
臣服心动
臣服心动 2020-11-30 06:17

I\'m working with EF5 in a MVC 4 aspnet website. Locally, everything works just fine, but when I publish it to the IIS and try to enter, I get the error

26条回答
  •  醉酒成梦
    2020-11-30 06:56

    I had the duplicate definition of connection string in my Project Cms.And the Context class is named:CmsContext

    In my case, the problem was solved, as I changed the connectionsting in Web.config as follow:in first one name is CmsContext and it's related to main project .in second one name is DefaultConnection and it's related to Identity

    
    
    

提交回复
热议问题