Click here to Skip to main content
12,350,831 members (31,553 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0 EF4.0
I am just getting started with Entity Framework and getting the following error in my code and would like to know how to proceed:

Error   29  Error 3027: No mapping specified for the following EntitySet/AssociationSet - COUNTRies, PRHs.  C:\svn_workspace\FoxTool\Source\Fox.DataAccessService\FoxEFModel.edmx   457 9   Fox.DataAccessService

I do not right now have any relationships set up (at least I see none).
Posted 17-May-12 7:17am
Edited 17-May-12 7:18am
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Sometimes if you make any changes to the EDMx file or if you change a database column and do an update the mapping xml representation for the EDMx file gets corrupte and you receive this error. just click control + A delete all objects in the EDMx file and add the database again, or you can open the EDmx file in the XML view and try to find the unmapped assosiacition and delete it
  Permalink  
Comments
Clifford Nelson 30-May-12 13:10pm
   
You hit it on the nose. Vote, thanks
nbethi 25-Jun-13 5:03am
   
When you Update From Database Model option, sometimes it does loose the mappings for some entities which are added manually.

Here is the workaround to overcome this issue you can open the EDMX in XML mode (right click on edmx and choose to open with XML) then you can manually add the new field that you wanted.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Go to Solution Explorer, click the Search button, leave checked both "Search within file content" and "Search External Files", type the entities name your mapping isn't recognizing. Delete all files RELATED to the problem. Those will probably be named after the same missing entity. DO NOT delete any file with your Context Class name on the file, specially if their extensions are .cs or .tt. In the Context .cs file, remove all lines of codes referencing the missing entity. They will look like this:

public virtual DbSet< COUNTRies> COUNTRies { get; set; }


This error is common to tables deleted from the database. You drop a table in the database, or you just change your web.config.connectionStrings for the EF Mapped database, pointing to a new, not the one you used to generate the original mappings and in this new db these entities with the 3027 error aren't present.
  Permalink  
v3
Comments
Richard MacCutchan 12-Dec-15 6:50am
   
This question is over 3 years old.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160621.1 | Last Updated 12 Dec 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100