Handle netstandard1.6 with xUnit

前端 未结 5 1770
轮回少年
轮回少年 2021-01-18 07:29

I am looking to use a test framework for a netstandard1.6 library. I tried to follow and edit Getting started with xUnit.net (.NET Core / ASP.NET Core) without success. Foll

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-18 08:03

    You can import the netcoreapp1.0 TFM to convince the tooling that the dependencies are compatible with the target framework:

    { 
      "dependencies": {
        "NETStandard.Library": "1.6.0",
        "xunit": "2.2.0-beta4-build3444",
        "dotnet-test-xunit": "2.2.0-preview2-build1029" 
      },
      "frameworks": {
        "netstandard1.6": {
          "imports": [ "netcoreapp1.0" ]
        }
      }
    }
    

    You can find a table of target framework monikers (TFM) in the NuGet documentation linked below, including a table of deprecated frameworks which includes dnxcore50 (replaced by netcoreapp1.0):

    https://docs.nuget.org/ndocs/schema/target-frameworks

提交回复
热议问题