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

前端 未结 19 1333
星月不相逢
星月不相逢 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 12:02

    In my case, it was necessary to include a reference to MsTest.TestAdapter module using nuget.

    A fresh project with MSTest.TestFramework and Microsoft.Net.Test.Sdk was not enough to run a single unit test.

    Noticing in my case I was using a test project targeting .NET framework 4.8 and not .NET core. Although, I strongly believe this fix might apply to that platform as well

提交回复
热议问题