dotnet commands failing when agent path has a space ("Program Files")

Answered

All of our dotnet commands are failing after upgrading to TeamCity 2021.2 (yesterday).  After spending some time investigating, it appears to be an issue in the ".rsp" file that's added to all of the build commands.  Our agents are installed at "D:\Program Files\", which (obviously) has a space. This path is added to the /l switch (without escaping) for the DLL path, which appears to cause issue for MSBuild.  Here is a snippet of the "1.rsp" file:

/noconsolelogger
/l:TeamCity.MSBuild.Logger.TeamCityMSBuildLogger,D:\Program Files\BuildAgentTwo\plugins\dotnet\tools\msbuild15\TeamCity.MSBuild.Logger.dll;TeamCity;verbosity=quiet;plain
/nodeReuse:false

And the error that MS Build reports:

MSBUILD : error MSB1008: Only one project can be specified.
[14:18:40]Switch: Files\BuildAgentTwo\plugins\dotnet\tools\msbuild15\TeamCity.MSBuild.Logger.dll;TeamCity;verbosity=quiet;plain
 
If I remove the /l line and run "dotnet" manually it works.  I haven't found how you escape the space.
 
Any suggestions to fix or work-around this issue?

Thanks,

Chris

1
2 comments

Hi,

This is a known issue: TW-73745. Here's a workaround.

Sorry that you have bumped into it.

1
Avatar
Permanently deleted user

Thanks Mikhail!  I tried the new version of the "dotnet" plugin and that's fixed our builds:

Work-around options:

1

Please sign in to leave a comment.