title: You must add a reference to assembly 'Microsoft.Data.Services.Client.Portable...' & NUGET
body: <p>I have created a VS2013 solution that contains multiple projects. One of those projects is a portable class library targeting .NET 4.5+, Silverlight 5, Windows Store 8+ and Windows Phone 8 and this project contains a reference to an OData service in an accompanying web application.</p>
  
  <p>The portable class library references Microsoft.Data.Services.Client.Portable (among others), added via nuget (WCF Data Services Client).</p>
  
  <p>I have then added the portable class library to a WPF (.NET 4.5) application, a Windows Store application and a Windows Phone application and written some very basic test code to access the service. This works fine in Windows Store and Windows Phone.</p>
  
  <p>The WPF application however will not compile. The errors are...</p>
  
  <ul>
  <li>The type 'System.Data.Services.Client.DataServiceContext' is defined
  in an assembly that is not referenced. You must add a reference to
  assembly 'Microsoft.Data.Services.Client.Portable, Version=5.6.0.0,
  Culture=neutral, PublicKeyToken=31bf3856ad364e35'.</li>
  <li>The type 'System.Data.Services.Client.DataServiceQuery`1' is defined in an
  assembly that is not referenced. You must add a reference to assembly
  'Microsoft.Data.Services.Client.Portable, Version=5.6.0.0,
  Culture=neutral, PublicKeyToken=31bf3856ad364e35'.</li>
  </ul>
  
  <p>The thing is, I also added the WCF Data Services Client to the WPF application via nuget, but it does not add a reference to the portable library (<code>packages\Microsoft.Data.Services.Client.5.6.0\lib\portable-net45+sl5+wp8+win8\Microsoft.Data.Services.Client.Portable.dll</code>), instead adding a reference to the full framework 4.0 version (<code>packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</code>) - which in turn is causing the error I am seeing.</p>
  
  <p>Is there something I am doing wrong here or is this an error in the installation package? Note that if I delete the offending reference and add the alternative reference manually then all is well so though I have a work-around I would still like to know if I am the cause of the error.</p>