Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
5.00/5 (5 votes)
See more:
I am just getting started with Entity Framework and getting the following error in my code and would like to know how to proceed:

VB
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
Updated 12-Apr-18 6:55am
v2

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
 
Share this answer
 
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.
Member 10442081 21-Sep-16 6:40am    
Thanks it worked. :)
shoaib ahmed siddiqui 24-May-23 9:45am    
It resolved my issue.
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:

C#
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.
 
Share this answer
 
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900