For a little background:
I have a DLL project with the following structure:
Rivworks.Model (project)
\\Negotiation (folder)
Model.edmx
If you are using web deployment from Visual Studio sometimes doesn't delete the old dlls. I had the same problem, change to Web Deployment Package and didn't give me problems.
In my case, the problem was caused by my connection string in Web.config being named the same thing as my entities container class.
Change
<add name="ConflictingNameEntities" connectionString="metadata=res://*/blahblah
to
<add name="ConflictingNameEntitiesConnection" connectionString="metadata=res://*/blahblah
and regenerate the container class by right-clicking ConflictingNameModel.Context.tt in Solution Explorer and clicking "Run Custom Tool".
In my case, probably after merging a version back, my startup project file (csproj) got corrupted.
Al the Entity classes where added:
<Compile Include="Class.cs">
<DependentUpon>MyModel.tt</DependentUpon>
</Compile>
After removing all relevant entries by hand the problem was solved.
Your two EDMX files probably have the same entity container name. You need to change (at least) one of them.
In the GUI designer, open Model Browser. Look for a node that says "EntityContainer: Entities". Click it. In Properties, change Name
to something else. Save and rebuild.
I had a same problem in my asp.net website, to resolve the problem I purposely added compile time error in one of the cs file in the app code by removing a semicolon, then I rectified the compilation problem by adding semicolon again.
This process caused application to compile again.After this error got vanished.
Hijacking this, since it is the top Google result for the error message.
In case anyone else encounters this while only using a single model/context: I once ran into this problem because the assembly containing the model/context was renamed and a copy with the previous name remained in the bin directory of the application. The solution was to delete the old assembly file.