Ryan, my friend. Oh my!
Just to be sure, I'm going to state what I believe to be your wish ... and then answer it. I think you want one model and you want multiple SL assemblies to be able to refer to it.
Let's get some basics down. If you want one model, then EXACTLY one SL assembly should hold that model. In your original example, it was SL1. Everything would have been fine had your SL2 referenced SL1. You may not want SL2 to reference SL1 ... but that's an architecture issue, not a technology one.
In attempting to create a "second" model based on the first, it looks like what you really did was tell the ObjectMapper that the corresponding SL project is SL2.
The OM -- which will generate one model designer file in the (.NET) Domain Model project -- thinks that the SL companion is in SL2. Indeed, in SL2 there is a link to the (.NET) model designer file named something like xxx.DomainModel.Designer.cs. You can tell it is a file link by the little shorcut symbol in the lower-left of the file icon in the VS Solution Explorer.
Meawhile, back in SL1, you've left behind a similar link back to this same (.NET) model designer file in DomainModel. The only difference at this point is that the OM thinks to maintain the link in SL2 and has "forgotten" the link in SL1.
Your VS Solution hasn't forgotten. Both SL1 and SL2 have links back to the same file in DomainModel. When you compile them, SL1 and SL2 each compile and each get their own copies of the domain model classes. If you defined a DomainModel.Customer in DomainModel project you will have another in SL1 and a third in SL2.
The amazing thing is that this actually works!
As long as SL1 and SL2 never refer to each other and no other assembly refers to both SL1 and SL2 you might survive. I'm not sure if the EntityManager will get confused after running in both SL1 and SL2; it probably will because once it learns about the model from either SL1 or SL2 it thinks it knows what the model looks like ... and won't relearn. Since DomainModel.Customer is structurally identical in both SL1 and SL2 there shouldn't be a problem.
If you rerun the OM, all three project models are updated. More precisely, you only ever update the DomainModel file (even if you manually edit ... which you shouldn't); the 2 file links point to it so, after compile, it is as if the OM updated all 3.
But it's a really bad idea. I'm going to completely forget about the fact that you are carrying the extra weight of two entire model definitions in your SL assemblies. I'm worried about confusion, mistakes, and the risk of referencing two assemblies that both have models (when you do that, the compiler will complain about duplicate definitions of some of your model classes).
Suppose you want to add custom logic, e.g., by adding Customer file with partial Customer class. You should put this in your DomainModel project and link to it in ... well you'll have to remember to link to it in SL1 and SL2.
When you want multiple SL assemblies to share the same model, CREATE A SILVERLIGHT MODEL PROJECT. Do as I did in Model and Prism Explorer; add a Silverlight "ClientModel" project. This is where you put the link files. This is where the OM should think to look for the doppleganger of the DomainModel Designer.cs file.
Then let SL1, SL2, SL3 .. SLn make reference to ClientModel. Now you have ONE copy of the model in Silverlight land.
How do you get there from where you are now? You're already hooked into SL2.
- Rename SL2 to "ClientModel"
- Create a new Silverlight project called "SL2"
- Move everything except the model link file from ClientModel to the new SL2
- Add a reference to ClientModel to SL2
- Remove the model link file from SL1
- Add a reference to ClientModel to SL1
- Open the xxx.DomainModel.ibedmx in the OM
- Change the associated SL project to "ClientModel"
I think this should get you back on the right track.
Happy trails! ... Ward