我正在将一个基于
Entity Framework 4.3
和.NET 4的项目迁移到Entity Framework 5
和.NET 4.5。在不进行任何更改的情况下,当我尝试运行项目时,代码优先模型配置会因出现 System.Data.MappingException
错误而失败,错误信息如下所示:
该错误信息并未指明导致问题的实体或关系,而我的模型相对复杂。有没有什么方法可以获取更详细的信息以便更容易诊断问题?(495,10) : error 3034: Problem in mapping fragments starting at lines 495, 536:Two entities with different keys are mapped to the same row. Ensure these two mapping fragments do not map two groups of entities with different keys to the same group of rows.
[5 other similar paragraphs removed]