title: Adding WCF RIA Services class library to Silverlight 5 application
body: <p>Trying to add <strong>WCF RIA Services class library</strong> to my SL5 app in VS 2010 but once I set the <strong>WCF RIA Services Link</strong> in class library properties, project fails to build with numerous "The type or namespace name 'QueryResult' could not be found", 'EntitySet', EntityQuery' errors...</p>
  
  <p>I'm following the MSDN Walkthrough <a href="http://msdn.microsoft.com/en-us/library/ee707351%28v=vs.91%29.aspx" rel="nofollow">Walkthrough: Creating a RIA Services Class Library</a> trying to port a subset of my WPF app to SL5 so I first created an SL5 application with RIA checkbox uncheked which created two projects:</p>
  
  <ul>
  <li>MySLApp (Silverlight 5) </li>
  <li>MySLApp.Web (.NET 4)</li>
  </ul>
  
  <p>Once I had that in place I added <strong>WCF RIA Services class library</strong> which created another two projects:</p>
  
  <ul>
  <li>MySLAppWCF (Silverlight 5)</li>
  <li>MySLAppWCF.Web (.NET 4)</li>
  </ul>
  
  <p>In MySLAppWCF.Web I created an <strong>ADO .NET Entity Data Model</strong> and added a <strong>Domain Service Class</strong> using an entity from the Data Model. At this point all these new projects buid fine so I added a reference to <strong>MySLAppWCF</strong> in my <strong>MySLApp</strong> project and a reference to <strong>MySLAppWCF.Web</strong> in my <strong>MySLApp.Web</strong> but the final step to get all this wired up is to set the <strong>WCF RIA Services Link</strong> in <strong>MySLAppWCF</strong> to <strong>MySLAppWCF.Web</strong> but once I do that it all blows up with numerous "The type or namespace couldn not be found" errors. I checked the references in the library and there is a reference to <code>System.ServiceModel</code> there.</p>
  
  <p>Any ideas on how to get all this working?</p>
  
  <p>EDIT: I kept digging and found something about adding a reference to <code>System.ServiceModel.DomainServices.Client</code> library which is located in RIA SDK so I did that and it took care of the original errors but now I'm getting <code>WebDomainClient</code> and <code>DomainServiceFault</code> not found in my <strong>MySLAppWCF</strong> project even after adding a reference to <code>System.ServiceModel.DomainServices.Client</code> there as well and these two appear to be in that namespace...</p>