Entity Framework 4 “Error 3004: Problem in mapping fragments starting at line” means you must generate your DB from your model first (Stack Overflow)
Posted by jpluimers on 2011/04/05
Entity Framework 4 is nice, but has very confusing error messages.
Maybe it is just me, but getting a feel for what each error message means, and how to cure the underlying mistake(s) is time consuming.
For instance, it took me quite a while to find out why this error occurred during a project build:
Error 3004: Problem in mapping fragments starting at line 569: No mapping specified for properties MyEntity.MyValue in Set MyEntities. An Entity with Key (PK) will not round-trip when: Entity is type [MyEntities.MyEntity]
The solution was simple, I had forgotten to manually perform the “Generate Database from Model…” step before building my solution and was glad I found it in this Stack Overflow answer:
Have since discovered that after I add/change/delete properties on my entities I must “Generate Database from Model” before I compile otherwise I get 3004 mapping errors.
Note that this generation is always a manual step; I haven’t found a way to automate that (if you have found a way: please add a comment below).
–jeroen
via: .net – Entity Framework 4 mapping fragment error when adding new entity scalar – Stack Overflow.






John Cena said
Love you my dear.. It works & you save my lots of time for wasting.
Rafa said
how I can “Generate database from the model”? thanks
jpluimers said
See the updated “Generate database from the model” link in the post. That leads you to a some great examples on how to do this.
Sugeesan said
Great jeroen… thanks a lot. This works fine
jpluimers said
You are most welcome.