Unable to find testhost.dll. Please publish your test project and retry

前端 未结 19 1064
星月不相逢
星月不相逢 2021-02-01 11:40

I have a simple dotnet core class library with a single XUnit test method:

TestLib.csproj:


  
            


        
19条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-01 11:58

    This error can occur if you upgrade xunit.runner.visualstudio to a version greater than 2.4.1. Versions up to and including 2.4.1 include a reference to Microsoft.NET.Test.Sdk but later ones don't, so you need to include the reference in your own project.

    Interestingly, I found that NCrunch still ran my tests without the additional reference, even though I couldn't run them via the CLI.

提交回复
热议问题