title: Cannot reference .NET Core library from UWP
body: <p>I have a <strong>.NET Core library</strong> with the following project.json:</p>
  
  <pre><code>{
    "version": "1.0.0-*",
    "dependencies": {
      "NETStandard.Library": "1.6.0"
    },
    "frameworks": {
      "netstandard1.6": { }
    },
    "scripts": {
      "postcompile": [
        "dotnet pack --no-build --configuration Release",
        "xcopy bin\\Release ..\\..\\lib\\ /Y"
      ]
    }
  }
  </code></pre>
  
  <p>where the postcompile script creates a <strong>nuget package</strong> which I added as a custom feed in VS, following <a href="http://docs.nuget.org/create/hosting-your-own-nuget-feeds" rel="noreferrer">these instructions</a>.
  This is because I want to <strong>reference it from a Windows Universal App</strong>, which cannot be otherwise (yet), according to <a href="https://stackoverflow.com/questions/38225130/what-class-library-to-use-to-be-reference-on-uwp-and-aspnetcore-apps">this question</a>.
  But when I try it, I get this message:</p>
  
  <pre><code>Package AEther 1.0.0 is not compatible with uap10.0 (UAP,Version=v10.0).
  Package AEther 1.0.0 supports: netstandard1.6 (.NETStandard,Version=v1.6)
  One or more packages are incompatible with UAP,Version=v10.0.
  </code></pre>
  
  <p>This is where it stops making sense to me. According to <a href="https://stackoverflow.com/questions/38181004/can-i-build-uwp-with-net-core">this</a>, it should work fine for netstandard >=1.6.0, while <a href="https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md" rel="noreferrer">this official table</a> says I need to target netstandard &lt;=1.4.0, but that doesn't change anything. More confusingly, if I downgrade <strong>both</strong> versions of netstandard (the dependency and the target framework) to, say, 1.5, I still get this exact same error without specifying 1.6 in any of my files.</p>
  
  <p><strong>Update</strong>
  The UWP project.json looks like this</p>
  
  <pre><code>{
    "dependencies": {
      "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.1"
    },
    "frameworks": {
      "uap10.0": {}
    },
    "runtimes": {
      "win10-arm": {},
      "win10-arm-aot": {},
      "win10-x86": {},
      "win10-x86-aot": {},
      "win10-x64": {},
      "win10-x64-aot": {}
    }
  }
  </code></pre>
  
  <p><strong>Can someone clear up</strong> either</p>
  
  <ol>
  <li>How to reference .Net Core libraries from UWP at all or</li>
  <li>What is going on in my specific case?</li>
  </ol>
  
  <p><strong>ANSWER</strong></p>
  
  <p>I solved it adding an import to the UWP app as follows:</p>
  
  <pre><code>{
    "dependencies": {
      "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.1"
    },
    "frameworks": {
      "uap10.0": { import [ "netstandard1.6" ] }
    },
    "runtimes": {
      "win10-arm": {},
      "win10-arm-aot": {},
      "win10-x86": {},
      "win10-x86-aot": {},
      "win10-x64": {},
      "win10-x64-aot": {}
    }
  }
  </code></pre>