Handle netstandard1.6 with xUnit

前端 未结 5 1772
轮回少年
轮回少年 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:08

    This worked for me. It seems existing xunit versions do not support the netstandard 1.6 library yet. Try changing your project json to look like this as provided for in xunit site. This also assumes that you created a .net core library project

    {
      "version": "1.0.0-*",
      "testRunner": "xunit",
      "dependencies": {
        "xunit": "2.2.0-beta2-build3300",
        "dotnet-test-xunit": "2.2.0-preview2-build1029"
      },
      "frameworks": {
        "netcoreapp1.0": {
           "dependencies": {
              "Microsoft.NETCore.App": {
                 "type": "platform",
                 "version": "1.0.0"
               }
             }
          }
       }
    }
    

提交回复
热议问题