Error 3004: Problem in mapping fragment starting at line [closed]

In my case am not allowed to modify existing tables but I discovered that when you add a new table with “Include foreign key columns in the model” checked in EF4 and the table doesn’t contain any foreign key relationships then you try to add a association it will trigger this error.

Defining Constraints in an EF4 model that don’t exist in the database


In case the linked article disappears, The solution is:

You need to open the properties window of the association and then click on the Referential Constraint ellipses to get to the ref constraint dialog. Then select the correct field for the ‘Dependent Property’ setting.

Leave a Comment