Entity Framework error - Error 11009: Property ' ' is not mapped

c# entity-framework mapping visual-studio-2008

Question

To improve an older project I am forced by the circumstances to use VS 2008 and Framework 3.5 - I have issues with the edmx showing bizarre behavior and not updating the entities as required.

The edmx throws me the above error, but when I go to the respective table and right click it - "Update Model from Database" there is no change, the error is still there.

If I delete the table from the diagram by selecting it and pressing del, then in the Model Browser It disappears from the .Database but when clicking "Update model from Database" I can't see i in the "Add" list, all I can do is "Refresh" the table since I still see it in the refresh list (which should not happen because I deleted it! )

1
44
6/18/2017 8:46:20 AM

Accepted Answer

Check the xml file of your model, it's probably still in there somewhere. Try deleting it manually from that XML file, then try to update again. Be sure to take backups though.

48
3/22/2016 9:14:53 PM

Popular Answer

I had this issue when I changed a column name from CampaignKey to CampaignCode. After making the DB change, I went to the .edmx designer, right clicked and chose Update Model from Database. Then when I compiled I got the error:

Error 11009: Property CampaignKey is not mapped.

Taking a closer look at my table in the designer showed me that Visual Studio had created the new field CampaignCode as in the DB. But it also had left the old field CampaignKey in there, causing the error as it no longer exists in the DB.

To fix the issue, I right-clicked on the CampaignKey field in my table in the designer and selected Delete.

After that I saved the .edmx, compiled and the error was gone.



Related Questions





Related

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