title: Testing .Net Core Library with xUnit
body: <p>I am creating a <code>.Net Core Library</code> that can be consumed by <code>ASP.NET Core</code> Application. By default Visual Studio create project.json as below</p>
  
  <pre><code>{
    "dependencies": {
  
      "NETStandard.Library": "1.6.0"
    },
    "frameworks": {
      "netstandard1.6": {
        "imports": "dnxcore50"
      }
    },
    "version": "1.0.0-*"
  }
  </code></pre>
  
  <p>I think its recommended to use <code>netstandard1.x</code> for libraries that will be consumed by other applications. I am going to remove <code>"imports": "dnxcore50"</code> because that was for older .NET Core preview versions (Before .NET Core 1.0 RTM and .NET Core RC2 were released)    </p>
  
  <p>Now I wanted to unit test this library using <code>xunit</code> so followed the article <a href="http://xunit.github.io/docs/getting-started-dotnet-core.html" rel="nofollow">Getting started with xUnit.net (.NET Core / ASP.NET Core)</a> 
  However xunit suggest to mark the library as .Net Core Application</p>
  
  <blockquote>
    <p>You may have noticed that part of what we did here was mark your class
    library as a .NET Core Application (the netcoreapp1.0 framework). When
    using .NET CLI for testing, unit test projects are actually an
    application*, not a class library. If you forget to make this change,
    the compiler will tell you that dotnet-test-xunit is not compatible
    with your class library project. We tell Visual Studio to generate a
    class library, though, because it most closely matches our desired
    project structure.</p>
    
    <ul>
    <li>The application's Main function is provided by the xUnit.net runner, not by you.</li>
    </ul>
  </blockquote>
  
  <p>So I have updated the project.josn as suggested and I was able to run the unit test. However I have questions:</p>
  
  <p>1> Is it recommended to change the target framework of the .Net Core library from <code>netstandard1.6</code> to <code>netcoreapp1.0</code> when that library can be consumed by other applications?</p>