Question

I have created a class library (targeted to .NET 4) containing all my entity framework models/context. I am referencing that class library from one project (targeted to .NET 4.5.1) and it works great, then I am referencing the same class library from another project (targeted to .NET 4) and it gives me this error:

Schema specified is not valid. Errors: 
Multiple types with the name 'places' exist in the EdmItemCollection in different namespaces.  Convention based mapping requires unique names without regard to namespace in the EdmItemCollection.

And then many more of the same error for all my entities.

No correct solution

OTHER TIPS

You seem to be hitting a type conflict. When resolving types EF does not use namespaces and if it sees two types with the same names it sometimes does not know which one to use. You can find more details in the bug EF team is tracking this issue: https://entityframework.codeplex.com/workitem/483. Also note that as of EF6 most scenarios are fixed when using Code First - see this work item for more details: https://entityframework.codeplex.com/workitem/911

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top