Skip to content

MSBuild properties are incorrectly formatted #4297

@Lordfirespeed

Description

@Lordfirespeed

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake Frosting

Cake version

4.0.0

Operating system

Linux

Operating system architecture

64-Bit

CI Server

No response

What are you seeing?

MSBuild arguments are rendered like so:

/property:DefineConstants=foo;bar;baz

Which leads to an error:
image

What is expected?

MSBuild properties should be specified in the correct format. For example:

/property:DefineConstants=foo;DefineConstants=bar;DefineConstants=baz

Steps to Reproduce

Create a task with the following Run implementation:

var buildSettings = new DotNetBuildSettings {
    Configuration = "Release",

    MSBuildSettings = new() {
        Properties = {
            {"DefineConstants", ["foo", "bar", "baz"] },
        },
    },
};

context.DotNetBuild(context.RootDirectory, buildSettings);

Ensure that context.RootDirectory is defined.

Run the task.

Notes

Related: #1852
Of note, I believe this comment is incorrect.
Perhaps WithProperty("DefineConstants", "A=a", "B=b"); should instead generate:

/p:DefineConstants=A=a;DefineConstants=B=b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions