Another error I recently ran into with RIA Domain Services and the Entity Framework model:
The type 'ProjectName.Web.YourType' already contains a definition for '_fieldName'
This is usually followed immediately by a second error (described the same way) except it shows the property name. This seems to occur when a navigation link in EF is named exactly the same as the internal SQL Server column name. For example, let's say you have a table with a field/column named ModifiedBy (represented as an int, and is a foreign key to another table), when the table is added to the EF model, it is represented as a navigation link. If you decide to rename the link to "ModifiedBy", EF will allow this, but when RIA generates metadata for the client side, it will complain because, in the metadata, it internally creates both - the object for the navigational link as well as the internal type of the field.
d15dc9a8-3590-404c-bad9-48c5f31d99ab|0|.0
While working with RIA domain services and Silverlight 3 beta, I ran across a strange problem. I would create the domain service based on my entity framework model, and the code generated was causing an error. I verified that the entity framework ran on its own, but it took me a while to figure out why I was getting an error similar to the following:
Invalid member projection specification : Projection path 'MyTableId' is
invalid for member 'MyNamespace.Web.MyTable.MyTable'
This error message is not very friendly. The reason why this happened is because inside the EF designer, I renamed the primary key in MyTable (we'll say from MyTableId to SomethingId). EF has no problems with renaming the primary key field, and compiles without any problem on its own. Unfortunately when you try to create a domain service, if you add the EF object along with other objects that associate to it (via the primary key), it fails to compile and gives the error message above. Whatever magic occurs behind the scenes when RIA generates the client metadata, it does not like the primary key to be different. The only workaround I know of is to rename it back to whatever it was. Unfortunately, if you are trying to use RIA Domain services with an existing EF model that has changes to the primary key names, you may have to play with it to get it to work.
fa9af4ee-1012-44b4-8778-efad12a5e426|0|.0