当 Visual Studio 2010 无法打开 Entity Framework 4 EDMX 文件时,如何恢复它?
我一直在关注 Entity Framework 4 in Action 的早期访问版本中的第 2 章中的示例,其中一个创建数据库架构,从数据库架构生成实体模型,然后执行一些有关对象继承、添加复杂属性等的实体自定义。一切都很好,直到我关闭并重新启动 Visual Studio 2010 SP1。重新启动后,我无法再使用设计器打开EDMX文件。我收到一个对话框,指出“无法加载 'C:\Projects\Test\Test.MyModel\Model.edmx':已添加具有相同密钥的项目。”。输出窗口中没有更多信息。
- 如何恢复该文件?
- 如何调试模型加载过程以找到有关尝试加载什么“项目”甚至它是什么类型的“项目”的更多信息?
I have been following the examples from Chapter 2 in an early access edition of Entity Framework 4 in Action whereby one creates a database schema, generates an entity model from the database schema, and then performs some entity customizations with regards to object inheritance, adding complex properties, etc. Everything was great until I closed and then restarted Visual Studio 2010 SP1. After restarting, I can no longer open the EDMX file with the designer. I get a dialog box stating "Cannot load 'C:\Projects\Test\Test.MyModel\Model.edmx': An item with the same key has already been added.". There is no further information in the Output window.
- How might one might recover the file?
- How might one debug the model loading process to find a little more information on what "item" is attempting to load or even what type of "item" it is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它是一个 XML 文件,因此您可以以文本模式打开它并查看问题所在。听起来好像可能存在名称重复的项目。
It's an XML file so you can open it up in text mode and see what the problem is. Sounds like there could be items with duplicate names somehow.