dotnet-test 可以指定运行时标识符吗?

The*_*Saw 5 c# .net-core

我正在尝试使用dotnet test,但我希望能够指定运行时标识符。具体来说,我需要在 32 位模式 (RID win-x86) 下运行单元测试。我可以使用dotnet rundotnet publish等设置 RID,但dotnet test似乎不支持这一点。有解决方法吗?

Kar*_*ayo 3

根据文档,你应该能够做到。

> dotnet 测试--帮助

Usage: dotnet test [options] <PROJECT | SOLUTION> [[--] <RunSettings arguments>...]]

...
Options:
  --runtime <RUNTIME_IDENTIFIER>           The target runtime to test for.
...
Run Code Online (Sandbox Code Playgroud)

所以在你的情况下,它应该是:

> dotnet 测试 --runtime win-x86

希望这可以帮助!