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
Note when trying to rename a entity container to that of a previously deleted entity container, you will need to go into your web.config or app.config and delete the connection string out of the configuration section.
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
Just in case anyone else is desperate and not finding any answers - I accidentally ended up with a copy of my .edmx file included in the project in a second location. Both were being included in the build.
;-)
If this happened to you, fear not: You were not the first.
I fixed this issue in EntityFramework 6.0 by.
During creation of the models, I name the .edmx to the name of the entities. i.e. (MYDbEntities)
After creation i open the MYDbEntities.Context.cs and modified the "Entities" Class to "MYDbEntities".
Make sure that the connection string is like this
metadata=res:///MYDbEntities.csdl|res:///MYDbEntities.ssdl|res://*/MYDbEntities.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=YourDb;persist security info=True;user id=sa;password=Sw0rdf!sh;multipleactiveresultsets=True;application name=EntityFramework"
Note: my entities resides in a separate DLL.
Hope this helps.
In my case none of the solutions worked. I finally recycled the IIS on my hosting to make it work. Hope this helps someone :)
Well, in my case I'm working diferent software architecture, because I have diferent projects (dlls), they access to the same Database, but I have diferent entities inside. So, when I have references in a project that needs all or at least two of them, i get this error
If I change the Entity Container Name on each one, I solve the problem, but now my connection string are diferent and I have to include all the connection strings in the config file for each dll I refer.