title: Entity Framework & Portable Class Library
body: <p>I have a solution containing a WPF Project and a Windows Phone Project, both having a reference to my PCL that contains my Models and ViewModels. I also have a WCF Project that allows me to call a common API. It worked just fine so far.</p>
  
  <p>Now I want to use Entity Framework to communicate with an SQL database so I can make request from my ViewModels. I thought about moving my Models from the PCL to the WCF project, and use them as entities. This implies to reference my WCF project in the PCL.</p>
  
  <p>Just like specified here: <a href="https://stackoverflow.com/questions/22879578/entity-framework-for-portable-class-library">Entity Framework for Portable Class Library</a> , I get the following error:</p>
  
  <p><strong>"Failed to add reference to 'System.ComponentModel.DataAnnotations'. Please make sure that it is in the Global Assembly Cache."</strong></p>
  
  <p>which is in reality a Nuget issue. (<a href="http://nuget.codeplex.com/workitem/2978" rel="nofollow">http://nuget.codeplex.com/workitem/2978</a>). The real reason is that Entity Framework is not compatible with PCLs anymore. From what I read, the Entity Framework 7 will allow me to do so, but it's impossible for now.</p>
  
  <p>Does anyone know a good way to communicate with my database with this configuration ?</p>