dotnet core中运行dotnet test时报错unable to find testhost.dll

  1. 在使用NUnit写单元测试,运行时报错
    unable to find testhost.dll
  2. 在使用 .NET Core Test Explorer扩展时,也发现不了解任何写好的测试

解决方法:
在单元测试项目中安装包:Microsoft.NET.Test.Sdk
并使用dotnet restore恢复包后运行dot net test 即可正常运行单元测试

如何使用nuget安装包,参见上一篇博客

Tools>Nuget Package Manager>Manage Nuget Packages For Solution…>Search for Microsoft.NET.Test.Sdk and install for your test project.

参考链接:https://github.com/Microsoft/vstest/issues/1870

猜你喜欢

转载自blog.csdn.net/u010178308/article/details/88966879
今日推荐