Unable to See the Model Classes While Adding a New Domain Service


According to a Tweet from Colin Blair you can also add the RiaServices.EntityFramework NuGet package to your project to fix this issue. 


The problem

The problem can be recreated by the following:

  1. Ensure your have a primary key defined in your table
  2. Create a new Silverlight Project, enable RIA services
  3. On the server side add a new Data Model then rebuild the solution
  4. Click on "Add" -> "New Item" -> "Domain Service class"
  5. You see a new "Add Domain Service Class" window but the classes from your model do not show up for use.


The Solution

The Solution is:

  1. Open your Model (.edmx file) in Model Designer (just double-click)
  2. Right-click in an empty space within the Model Designer & choose "Properties"
  3. Change the value of "Code generation strategy" from "None" to "Default"

  4. Select the Server Project Name (for example MyExample.Web) & click on the "Show All files" button on:


  5. Expand the "model.edmx" file & locate & delete the 2 .tt files.

  6. Rebuild the solution
  7. Now click on "Add" -> "New" -> "Domain Service"

Pooff!! This time you will see the classes available in the Add Domain Service Class window.


Hope this helps some poor soul out there like me.


Similar Articles