xamarin xUnit-cli无法在MacOS上找到dotnet

neekobn8  于 2022-12-20  发布在  Mac
关注(0)|答案(1)|浏览(107)

我有一个Xamarin表单项目,我在Intel Mac上运行。我们使用XUnit进行单元测试。我希望能够在Mac上的命令行上运行测试。测试在IDE中运行,但我无法让它们在命令行上运行。我尝试了许多不同的选项,但似乎都不起作用。目前的方法是“我尝试使用XUnit cli工具运行测试。
我已经安装了dotnet并在我的路径上运行
第一个月
退货
6.0.110
我使用以下命令安装了xunit-cli
dotnet tool install -g xunit-cli
我已经在路径上添加了xunit,但是,当我运行xunit-cli时,我收到以下错误

You must install .NET to run this application.

App: /Users/luke/.dotnet/tools/xunit
Architecture: x64
App host version: 6.0.10
.NET location: Not found

Learn about runtime installation:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=osx.13-x64&apphost_version=6.0.10

我的设置哪一部分不正确?

0vvn1miw

0vvn1miw1#

您真的需要使用xunit-cli吗?
您可以简单地在测试项目中安装Microsoft.NET.Test.Sdk NuGet包,然后使用dotnet test

dotnet test MyProject.csproj

相关问题