Brian Ogden
Brian Ogden

Reputation: 19232

The mapping of CLR type to EDM type is ambiguous with EF 4 classes ARE in a separate assembly

So I am using a model first EF pattern, not code first. I have my "POCOs" in separate assemblies and I getting the error:

The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'request_saga'. Previously found CLR type 'MyDal1.request_saga', newly found CLR type 'MyDal2.request_saga'. this is in project.foo

So this popular SO question and answers does not solve my problem as my POCOs are in separate assemblies: The mapping of CLR type to EDM type is ambiguous with EF 6 & 5?

That is one of the two recommended solutions for this problem as can be found here:

https://social.msdn.microsoft.com/Forums/en-US/5a8ea003-c6bc-4fc6-ad2a-634f09447c49/ef4-mapping-of-clr-type-to-edm-type-is-ambiguous-error?forum=adodotnetentityframework

Giving my POCOs different names is not an option. Am I missing something? It seems very clear that having the POCOs with the same name in separate projects is a very viable solution but it is not working for me.

I should also note that other developers are not have this problem on their machines, just me on my machine.

Upvotes: 0

Views: 4865

Answers (1)

user3097514
user3097514

Reputation: 359

I had a problem like this once that had me baffled for a while. I used data first and copied the wrong connection string. it forced EF to resolve using the wrong model. I basically started over with the connection string, and presto.

Make sure your data first connection string lists the model properties correctly.

Upvotes: 1

Related Questions