我是一名有用的助手,可以为您翻译文本。
我有一个.NET 5.0单元测试项目,我正在尝试使用MSTest通过命令行执行它。
我使用以下命令来运行单元测试:
但是我收到了以下错误信息:
我在这里看到了类似的问题,例如Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies,但是答案提到要编辑一个 app.config 文件,而我在我的项目中没有这个文件。
这是否只是在我尝试的方式中使用 .NET 5.0 和 MSTest 的限制?还是说我可以做些什么来让 MSTest 运行测试?
我有一个.NET 5.0单元测试项目,我正在尝试使用MSTest通过命令行执行它。
我使用以下命令来运行单元测试:
MSTest.exe /testcontainer:tests\bin\Debug\net5.0\UnitTestProject.dll
但是我收到了以下错误信息:
Unable to load the test container 'tests\bin\Debug\net5.0\UnitTestProject.dll'
or one of its dependencies. Error details: System.IO.FileNotFoundException:
Could not load file or assembly 'System.Runtime, Version=5.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
The system cannot find the file specified.
我在这里看到了类似的问题,例如Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies,但是答案提到要编辑一个 app.config 文件,而我在我的项目中没有这个文件。
这是否只是在我尝试的方式中使用 .NET 5.0 和 MSTest 的限制?还是说我可以做些什么来让 MSTest 运行测试?
MSTest.exe
,或者可以尝试使用dotnet test
? - mu88