错误 2002:作为此 MSL 的一部分指定的存储模型的 EntityContainer 'X' 在 MetadataWorkspace 中不存在

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

我正在尝试将我的 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 Designer,而是选择了 Code First from database 选项,而且,哦,你知道什么,错误消息现在告诉你究竟是什么问题! (Table 个名称和列)。