C# project build failed with double quotes in MSBuild parameter
I recently upgrade Teamcity from TeamCity Enterprise 2019.2.1 (build 71758) to Enterprise 2023.05.4 (build 129421).
In the old version, one build step is MSbuild runner and in the command line parameters, I have a parameter -p:PublisherName="Comapy Name". There is a space in the company name so I use double quotes. The parameter works OK in 2019.2.1.
However, after upgrade to 2023.05.4, I change the runner type from MSBuild to .Net with MSBuild command. The PublisherName parameter with double quotes does not work anymore. In the log, Teamcity builds the command as "-p:PublisherName="Comapy Name"", it adds extra double quotes on the parameter so MSbuild failed. Below picture is captured from the log. If I remove the space and double quotes, the build success because the parameter is in correct format -p:PublisherName=ComapyName
Please help on this issue
Please sign in to leave a comment.
Hi Kang,
The following section of documentation might help you with this:
https://www.jetbrains.com/help/teamcity/net.html#How+to+pass+parameters+containing+spaces
Thanks,
Guilherme