-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Priority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseneeds-designRequires discussion with the dev team before attempting a fix.Requires discussion with the dev team before attempting a fix.triagedxplat
Description
When a property contains backslashs in a project file, it will be converted to forward slashs when running with msbuild on Linux.
While this would be fine for paths (although one could just as well use forward slash in the project file since that works on both Windows and Linux), it causes problems when trying to set a regular expression in a property which requires a backslash to escape the next character.
Steps to reproduce
Project file bug.proj:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Regex>\(([^]]+)\)</Regex>
</PropertyGroup>
<Target Name="Build">
<Message Text="Regex=$(Regex)"/>
</Target>
</Project>Command line
msbuild /t:Build bug.proj
Expected behavior
Outputs the line
Regex=\(([^]]+)\)
Actual behavior
Outputs the line
Regex=/(([^]]+)/)
Environment data
msbuild /version output: 15.6.0.0
Also happens with xbuild from older Mono versions.
When building with dotnet build -v d bug.proj the output is as expected.
OS Info:
Ubuntu 16.04.4 LTS
lassana, momchilstefanov, rmunn, george-chakhidze, tillig and 10 more
Metadata
Metadata
Assignees
Labels
Priority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseneeds-designRequires discussion with the dev team before attempting a fix.Requires discussion with the dev team before attempting a fix.triagedxplat