The conceptual model type could not be found. entity-framework entity-model


Within two MVC3 projects, A and B, I have two entity data models.

The problem is that now the current code has stopped functioning and I am receiving the following error while attempting to access code inside entity model A. I recently introduced the new entity data model B to deal with some new features.

The warning reads:

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

Since entity model A hasn't changed in any way, I'm not sure why this new feature has impacted the existing code. Additionally, functionality B belongs to a different class and does not conflict with model A.

The code functions as it should when the new code is taken out of the project and entity model B is not included.

Here is a portion of the error's stacktrace:

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()
1/23/2012 4:48:02 PM

Accepted Answer

Found a solution. There seems to be a mix-up in the code produced by the algorithm in certain instances (randomly).entity framework . There should be a patch for this apparent problem in future editions. The interim solution to this is to shift theefm to a different class within the answer.

8/1/2013 3:48:05 PM

Popular Answer

I had the same issue with 2 different.edmx files in the same project. For starters.edmx model I'd utilized"Add Code Generation Item" while I hadn't for the second model. The project was successfully built, however during runtime it threw that error.

I succeeded in creating instruction for the second.edmx model and also

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow