dotnet test -p:Platform does not appear to work anymore
See original GitHub issueDescribe the bug
On dotnet test version 17.1.1.12406, the following worked fine:
dotnet test foo.bar.tests --no-build -c Debug /property:Platform="AnyCPU"
whereas on dotnet test version 17.4.0.51802 the platform property is completely ignored. On the machine with the lower version, I have .NET 6.0 (6.0.203), whereas on the machine with the higher version I have .NET 7.0 (7.0.100).
To Reproduce
Create a C# test assembly which has a platform defined (e.g. AnyCPU), add a unit test to it, and try the above.
Further technical details
- Include the output of
dotnet --info
- The IDE (VS / VS Code/ VS4Mac) you’re running on, and its version
- Output of
dotnet --info
on the machine where it works:
.NET SDK (reflecting any global.json): Version: 6.0.203 Commit: a20feadf6d
Runtime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.203\
global.json file: Not found
Host: Version: 6.0.11 Architecture: x64 Commit: 943474ca16
.NET SDKs installed: 3.1.425 [C:\Program Files\dotnet\sdk] 6.0.201 [C:\Program Files\dotnet\sdk] 6.0.202 [C:\Program Files\dotnet\sdk] 6.0.203 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
- Output of
dotnet --info
on the machine where it does not work:
.NET SDK: Version: 7.0.100 Commit: e12b7af219
Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.100\
Host (useful for support): Version: 3.1.31 Commit: 0e404aa9b8
.NET Core SDKs installed: 3.1.425 [C:\Jenkins\core-cli-tools\sdk] 7.0.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.31 [C:\Jenkins\core-cli-tools\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.31 [C:\Jenkins\core-cli-tools\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.31 [C:\Jenkins\core-cli-tools\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
Many thanks!
Hi @rogerlord, thanks for your feedback!
This is a dupe of https://github.com/microsoft/vstest/issues/4014. Issue is fixed and it will be available in .NET
7.0.101
.