asp.net-mvc - 错误 2002 : The EntityContainer 'X' for the storage model specified as part of this MSL does not exist in MetadataWorkspace

标签 asp.net-mvc odp.net

我正在尝试将 Oracle 数据库集成到 ASP.NET 应用程序中,但我不断收到此错误:

Error 2002: The EntityContainer 'OracleDBTargetContainer' for the storage model specified as part of this MSL does not exist in MetadataWorkspace.

我已经尝试了所有我能想到的方法,但仍然无法找出问题所在。 我该如何诊断其根本原因?

这对我来说仍然是新鲜事,所以我可能会错过一些非常明显的东西。

我假设它不像我的数据库,因为当我集成另一个数据库时显示的图表。我检查了外键、主键……但没有什么好处。

将 VS2013 与 ODP.NET 12c 第 3 版结合使用。

编辑:我的 EntityContainerMapping 是空的,这正常吗?

<EntityContainerMapping CdmEntityContainer="PMModelContainer" StorageEntityContainer="PMModelTargetContainer"></EntityContainerMapping>

最佳答案

我发现出了什么问题。

我的一个外键与主键不匹配(数字 20 而不是数字 10)

我在堆栈溢出上看到这可能是一个问题,并检查了我的表,但我显然错过了那个。

我是怎么意识到的?好吧,因为我没有创建 EF 设计器,而是选择了 Code First from database 选项,哦,你知道吗,错误消息现在准确地告诉你问题是什么! (表名称和列)。

关于asp.net-mvc - 错误 2002 : The EntityContainer 'X' for the storage model specified as part of this MSL does not exist in MetadataWorkspace,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32626511/

相关文章:

javascript - 将数据列表获取为 HTML,从 JavaScript 中的 Controller 中选择

asp.net-mvc - 如何在 ASP.NET MVC Controller 中设置小数点分隔符?

jquery - 如何使用jquery禁用kendo ui下拉列表?

nhibernate - NHibernate 和 DateTime 映射的问题

c# - 使用引用游标作为 ODP.NET 的输入类型

c# - 在 post 请求 asp.net mvc 中更改模型属性

c# - <$G+$> 出现在 ASP.NET MVC5 Helper 中的奇怪字符

visual-studio-2012 - Visual Studio ODP 非托管驱动程序 - 无法找到默认的 tnsnames.ora 文件 (12c)

.net - Managed Oracle ODP.NET 驱动程序是否使用网络加密?

c# - 无法在 C# 中解析 Oracle 时间戳