简体   繁体   English

CLR类型到EDM类型的映射是模糊的 - 适用于某些机器

[英]The mapping of CLR type to EDM type is ambiguous - works in some machines

We are facing a specific scenario with EF (using 6.2). 我们正面临EF的特定场景(使用6.2)。

We have a framework library which uses some of the common entities(framework related tables like Users, Roles, Access etc.) and the DAL uses all Database tables/views (including the framework's). 我们有一个框架库,它使用一些公共实体(框架相关表,如Users,Roles,Access等),DAL使用所有数据库表/视图(包括框架)。 so we have EDMX in framework project with subset of tables and DAL has another EDMX with full DB ref. 所以我们在框架项目中有EDMX和表子集,而DAL有另一个EDMX和完整的DB ref。

Now this is working fine in one of the machine where the framework libraries are built. 现在,这在构建框架库的机器中工作正常。 while we copy the framework dlls and rest of project code to another dev machine, we are getting the CLR mapping issue, that to for some of the entities (not all). 当我们将框架dll和项目代码的其余部分复制到另一个dev机器时,我们得到了CLR映射问题,这对于某些实体(并非所有实体)都是如此。

We tried with recreating the DAL's EDMX and reset the references in vain. 我们尝试重新创建DAL的EDMX并徒劳地重置引用。 The configuration and other libraries seems to be same in both machines. 两台机器中的配置和其他库似乎相同。

Unfortunately we cannot change EDMX file manually, as multiple developers keep working the the project with frequent EDMX updates. 遗憾的是,我们无法手动更改EDMX文件,因为多个开发人员继续使用频繁的EDMX更新来处理项目。 So each time updating may not be a best bet. 所以每次更新可能都不是最好的选择。

Just figured out that both the connection string (framework's and DAL's) in the non-working machine were referring to single model, which is causing the problem.. 刚刚发现非工作机器中的连接字符串(框架和DAL)都指的是单一模型,这导致了问题。

<add name="CoreDBEntities" connectionString="metadata=res://*/Models.CoreDBModel.csdl|res://*/Models.CoreDBModel.ssdl|res://*/Models.CoreDBModel.msl;

<add name="AppDBEntities" connectionString="metadata=res://*/Models.CoreDBModel.csdl|res://*/Models.CoreDBModel.ssdl|res://*/Models.CoreDBModel.msl;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 CLR类型到EDM类型的映射在EF 6和5中不明确? - The mapping of CLR type to EDM type is ambiguous with EF 6 & 5? CLR类型到EDM类型的映射不明确,因为有多个CLR类型 - The mapping of CLR type to EDM type is ambiguous because multiple CLR types CLR类型到EDM类型的映射与EF 4类ARE在单独的程序集中不明确 - The mapping of CLR type to EDM type is ambiguous with EF 4 classes ARE in a separate assembly CLR类型到EDM类型的映射不明确,因为多个CLR类型与EDM匹配 - The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM 如何找到OData edm模型类型到clr类型的映射? - How to find mapping of OData edm model type to clr type? GraphQl .NET DateGraphType CLR 类型映射问题 - GraphQl .NET DateGraphType CLR Type Mapping Issue 没有为CLR类型&#39;SqlParameter&#39;找到到关系类型的映射 - No mapping to a relational type can be found for the CLR type 'SqlParameter' EFCore 2.2 无法为 CLR 类型“Expression[]”找到到关系类型的映射 - EFCore 2.2 No mapping to a relational type can be found for the CLR type 'Expression[]' 对于 CLR 类型“Int32[]”,找不到到关系类型的映射 - No mapping to a relational type can be found for the CLR type 'Int32[]' Npgsql 6.x:如何查找 CLR 类型的类型映射 - Npgsql 6.x: How to find type mapping for CLR Type
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM