JetBrains / teamcity-dotnet-plugin

TeamCity plugin for .NET projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid semicolon escaping when passing property via .rsp

AlexanderK46 opened this issue · comments

We can successfully pass properties containing semicolons as command line arguments. For example, on Windows

dotnet msbuild /p:NoWarn=\"1591;1573;3001;3002\"

If we try to pass similar properties through system.* configuration parameters, we get a value that MSBuild does not correctly perceive. For example, if we have the parameter system.NoWarn = 1591;1573;3001;3002, in the rsp file we get the following

/p:NoWarn=1591%3B1573%3B3001%3B3002

The reason is that semicolons are escaped in rsp parameters. Such a parameter value cannot be converted to ItemGroup in MSBuild. The correct value in the rsp file should be

/p:NoWarn=1591;1573;3001;3002

As workaround, we must intercept all parameters containing a semicolon and execute $([MSBuild]::Unescape())

Additional info in https://github.com/dotnet/cli/issues/7791

Fixed in TeamCity 2019.2.1. Just add the TeamCity system property like system.NoWarn=1591;1573;3001;3002 without double quotes.

https://youtrack.jetbrains.com/issue/TW-63545
The correct value in the rsp file should be /p:NoWarn="1591;1573;3001;3002"
To escape symbols %and ; see this page

To pass semicolon via msbuild param use this sample:/p:SomeParam=\"abc;xyz\"