Skip to content

Whitespace in property names not issuing error #12352

Description

@am11

Issue Description

It seems like changes in #5672 were reverted. Using $( FOO ) in condition no longer raises an error.

Steps to Reproduce

$ cat > foo.proj <<EOF
<Project>
  <PropertyGroup>
    <Foo>test</Foo>
  </PropertyGroup>

  <Target Name="Build">
    <Message Text="Foo: '\$(Foo)' and with whitespace: '\$( Foo )'" Importance="High" />
  </Target>
</Project>
EOF

$ dotnet build foo.proj -v:d
Restore complete (0,0s)
  foo succeeded (0,0s)
    Foo: 'test' and with whitespace: ''

Expected Behavior

Expected error MSB4259: Unexpected space at position "{1}" of condition "{0}". Did you forget to remove a space?.

Actual Behavior

There was no error.

Analysis

No response

Versions & Configurations

$ dotnet --info
.NET SDK:
 Version:           10.0.100-rc.1.25414.111
 Commit:            f8a57b66e6
 Workload version:  10.0.100-manifests.2f8afce5
 MSBuild version:   17.15.0-preview-25414-111+f8a57b66e

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.6
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /Users/adeel/.dotnet10/sdk/10.0.100-rc.1.25414.111/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions