nuke-build / nuke

🏗 The AKEless Build System for C#/.NET
https://nuke.build
MIT License
3.07k stars 367 forks source link

SetProperties / Property, key not passed to MsBuild, only value #1462

Closed yankun closed 4 hours ago

yankun commented 5 hours ago

Usage Information

9.0.1

Description

Using SetProperty or SetProperties on the DotNetMSBuild configuration not passes the keys properly to msbuild. DotNetBuild is not affected by this.

As example

DotNetMSBuild( _ => _ .SetTargetPath(Solution) .SetConfiguration(Configuration) .EnableTreatWarningsAsErrors() .SetVerbosity(DotNetVerbosity.quiet) .EnableNoLogo() .SetProperties(new Dictionary<string, object>() { {"UseRazorBuildServer", true}, {"UseSharedCompilation", true}, {"MinVerBuildMetadata", $"{DateTime.Now:yyyy-MM-dd-hh-mm-ss}"} }) .DisableRestore());

Will result in following call:

dotnet msbuild MySolution.sln /property:Configuration=Debug /property:true /property:true /property:2024-11-25-04-55-52 /verbosity:quiet /nologo

Reproduction Steps

Create a simple build and add a property to call msbuild, like .SetProperty("UseSharedCompilation", true)

Expected Behavior

Call to msbuild should be as before:

dotnet msbuild MySolution.sln /property:Configuration=Debug /property:UseRazorBuildServer=true /property:UseSharedCompilation=true /property:MinVerBuildMetadata=2024-11-25-04-55-52 /verbosity:quiet /nologo

Actual Behavior

Property keys are missing from the call.

Regression?

No response

Known Workarounds

No response

Could you help with a pull-request?

No