Entity Framework error - “The EntityContainer name must be unique”

前端 未结 10 2288
南旧
南旧 2021-02-07 09:24

We have a solution which consists of two projects - a console application project and a web application project. Each of these has an identical in schema, but differently named

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-07 09:45

    Change the webconfig file entity connection string entry from this

    metadata=res://*/App_Code.AAA.csdl|res://*/App_Code.AAA.ssdl|res://*/App_Code.AAA.msl;provider=System.Data.SqlClient;provider connection string="data source=XXX;initial catalog=XXX;user id=XXX;password=XXX;multipleactiveresultsets=True;App=EntityFramework"" 
    providerName="System.Data.EntityClient
    

    to

    metadata=res://MyProject/App_Code.AAA.csdl|res://MyProject/App_Code.AAA.ssdl|res://MyProject/App_Code.AAA.msl;provider=System.Data.SqlClient;provider connection string="data source=XXX;initial catalog=XXX;user id=XXX;password=XXX;multipleactiveresultsets=True;App=EntityFramework"" 
    providerName="System.Data.EntityClient
    

提交回复
热议问题