문제

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.

올바른 솔루션이 없습니다

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top