找不到概念模型类型 [英] Could not find the conceptual model type

查看:600
本文介绍了找不到概念模型类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MVC3项目A和B中的两个实体数据模型。

我最近增加了新的实体数据模型B到处理一些新的功能,问题是,现在已有code已停止工作,并试图访问内code时,我收到以下错误实体模型中的。

错误消息是:


  

找不到概念模型类型project.models.Bclass


我不明白为什么它是这一新功能已经影响到当前code看到的实体模型A未以任何方式更改。而功能B是一个单独的类,并且不与模型中的干扰。

在新的code从项目和实体B型除去被排除在外则code ++工程,因为它应该。

下面是一些来自错误的堆栈跟踪的:

 异常:找不到'Project1.Models.CrossSession'概念模型类型。
应用类 - 方法:System.Data.Metadata.Edm.MetadataWorkspace - GetEdmSpaceType
用户:temp.user
网址:HTTP://本地主机/ PROJECT1 /认证/消息
堆栈跟踪:在System.Data.Metadata.Edm.MetadataWorkspace.GetEdmSpaceType(StructuralType objectSpaceType)
   在System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappings()
   在System.Data.Entity.Internal.InternalContext.TryUpdateEntitySetMappingsForType(类型的EntityType)
   在System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(类型的EntityType)
   在System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   在System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()


解决方案

解决方案中。它出现在某些情况下(随机)存在于由实体框架产生的code混合起来。这显然​​是一个已知的bug和修复程序应在未来的版本到来。在平均时间解决这个问题的方法是将 EFM 移动到一个单独的类的解决方案中。

I have two Entity Data models within a MVC3 project A and B.

I have recently added the new entity data model B to deal with some new functionality, the issue is that now the existing code has stopped working and I am getting the following error when trying to access code within entity model A.

The error message is:

Could not find the conceptual model type 'project.models.Bclass'

I do not understand why it is this new functionality has affected the current code seeing as entity model A has not change in any way. And functionality B is in a separate class and does not interfere with model A.

When the new code is removed from the project and entity model B is excluded then the code works as it should.

Here is some of the stacktrace from the error:

Exception : Could not find the conceptual model type for 'Project1.Models.CrossSession'.
Application Class - method : System.Data.Metadata.Edm.MetadataWorkspace -- GetEdmSpaceType
User : temp.user
Url : http://localhost/project1/auth/message
Stacktrace :    at System.Data.Metadata.Edm.MetadataWorkspace.GetEdmSpaceType(StructuralType objectSpaceType)
   at System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappings()
   at System.Data.Entity.Internal.InternalContext.TryUpdateEntitySetMappingsForType(Type entityType)
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()

解决方案

Solution found. It appears in some cases (randomly) there is a mix up in the code generated by the entity framework. This is apparently a known bug and a fix should be coming in future releases. In the mean time the way around this is to move the efm to a separate class within the solution.

这篇关于找不到概念模型类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆