title: How can I make a .NET Core class library and reference it from a .NET 4.6 project?
body: <p>I want to:  </p>
  
  <ul>
  <li>Make a class library that defines some interfaces and simple generic helper classes. It'll rely on generic collections and <code>IQueryable&lt;T&gt;</code> but no third party dependencies (well, <code>JetBrains.Annotations</code>).</li>
  <li>Be able to reference that class library from everywhere (specifically UWP, net46 and ASP.Net Core RC2)</li>
  <li>Ideally, use the project.json system throughout, although I'm prepared to sacrifice that if need be.</li>
  <li>Publish the finished library to a NuGet feed and from there use it in other apps</li>
  </ul>
  
  <p>When creating my class library project in Visual Studio 2015.2, I found the <code>Class Library (.NET Core)</code> template, which states</p>
  
  <blockquote>
    <p>A project template for creating a class library as a NuGet package that can target any platform</p>
  </blockquote>
  
  <p>Any platform! Brilliant... But I can't get it to work. After a lot of fiddling, I currently have the following <code>project.json</code> (I've probably completely broken it by now):</p>
  
  <pre class="lang-json prettyprint-override"><code>{
  "title": "My Really Useful Class Library",
  "copyright": "Copyright © 2015-16 Tigra Astronomy, all rights reserved",
  "description": "Really neat stuff",
  "language": "en-GB",
  "version": "1.0.0-*",
  "dependencies": {
      "JetBrains.Annotations": "10.1.4",
      },
  "frameworks": {
      "netstandard1.5": {
          "imports": "dnxcore50",
          "dependencies": {
              "NETStandard.Library": "1.5.0-rc2-24027",
              "System.Linq.Expressions": "4.0.11-rc2-24027"
              }
          }
      "net46": {
          "frameworkAssemblies": {
              "System.Collections": "4.0.*"
              },
          "dependencies": {}
          }
      },
      "buildOptions": {
          "xmlDoc": true
          }
  }
  </code></pre>
  
  <p>The next thing I did was create my .NET Framework 4.6 project in the same solution, and try to reference the class library. It lets me add the reference but I'm getting build errors, unresolved symbols, R# is unhappy, etc.</p>
  
  <p>I guess I'm not doing it right (no surprise, really, as I'm fumbling in the dark).</p>
  
  <p>I've read some of the docs about TFMs, frameworks and libraries but none of it really makes much sense.</p>
  
  <p>What do I really need to put in my class library's <code>project.json</code>, so that I can reference it from my .net framework 4.6 app, and also from UWP and ASP.NET Core RC2 apps? Is this really the right approach or have I started out on the wrong foot?</p>