-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Description
Version Used:
5.0.103
Steps to Reproduce:
- In a csproj which consumes a configurable analyzer / generator, add
<PropertyGroup> <Foo>Foo;Bar</Foo> <!-- I've also tried this, w/o success <Foo_>Foo;Bar</Foo> <Foo>$([MSBuild]::Escape('$(Foo_)'))</Foo> --> </PropertyGroup> <ItemGroup> <CompilerVisibleProperty Include="Foo" /> </ItemGroup>
- In the analyzer
AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.Foo", out string value)
Expected Behavior:
value should contain the whole value - "Foo;Bar"
Actual Behavior:
value contains only "Foo", ;Bar is escaped as an .INI comment
I've dug around a bit, and the issue seems to be in how the parameters are being passed to WriteAllLines here:
| <WriteLinesToFile Lines="$(_GeneratedEditorConfigFileContent)" File="$(GeneratedMSBuildEditorConfigFile)" Overwrite="True" WriteOnlyWhenDifferent="True" /> |
It unescapes the _GeneratedEditorConfigFileContent value even if it's (manually) escaped:


