You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing MSBuild properties to 'dotnet test' is not working in .NET 7 RC2.
If you try to run a command like dotnet test <csproj path> /p:Framework=net7.0, the Framework property does not get propagated.
This works fine with dotnet build but it stopped working with dotnet test in .NET 7.
Try to run dotnet test <csproj path> -v n /p:Framework=net7.0 and this should fail with the error:
error NETSDK1013: The TargetFramework value '' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly.
I have .NET 7 RC2 installed. I tried to add a global.json to force .NET 6 to be used and the command worked as expected. The issue is only observed in .NET 7.
Exceptions (if any)
Further technical details
Include the output of dotnet --info
.NET SDK:
Version: 7.0.100-rc.2.22477.23
Commit: 0a5360315a
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\
Host:
Version: 7.0.0-rc.2.22472.3
Architecture: x64
Commit: 550605cc93
.NET SDKs installed:
6.0.400 [C:\Program Files\dotnet\sdk]
7.0.100-rc.2.22477.23 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-rc.2.22476.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-rc.2.22472.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0-rc.2.22472.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
I am running Visual Studio 2022 but the issue is observed on the command line.
The text was updated successfully, but these errors were encountered:
With that being said, @baronfel has been working hard to get it fixed. Closing this as a duplicate, the rest is tracked in the linked issue. Thanks for reporting it, it's important this is fixed!
Describe the bug
Passing MSBuild properties to 'dotnet test' is not working in .NET 7 RC2.
If you try to run a command like
dotnet test <csproj path> /p:Framework=net7.0
, the Framework property does not get propagated.This works fine with
dotnet build
but it stopped working withdotnet test
in .NET 7.To Reproduce
If you have a csproj such as:
Try to run
dotnet test <csproj path> -v n /p:Framework=net7.0
and this should fail with the error:I have .NET 7 RC2 installed. I tried to add a
global.json
to force .NET 6 to be used and the command worked as expected. The issue is only observed in .NET 7.Exceptions (if any)
Further technical details
dotnet --info
I am running Visual Studio 2022 but the issue is observed on the command line.
The text was updated successfully, but these errors were encountered: