After a an update to the .NET Core SDK and TeamCity we started having problems with one of our services during deployment. The service is built as a self-contained application, and we use TeamCity for our build steps. The .NET CLI plugin in TeamCity passes in an rsp file after the arguments and this is what is causing the the problem.
[15:46:34] [publish] Starting: "C:\Program Files\dotnet\dotnet.exe" publish services\Konstrukt.Service.Data\DataServiceBroker\DataServiceBroker.csproj --framework netcoreapp2.1 --configuration Release --runtime win7-x64 --self-contained @C:\TeamCity\buildAgent\temp\agentTmp\4.rsp
error MSB4030: "@C:\TeamCity\buildAgent6\temp\agentTmp\4.rsp" is an invalid value for the "IsSelfContained" parameter of the "GenerateDepsFile" task. The "IsSelfContained" parameter is of type "System.Boolean". [C:\TeamCity\buildAgent\work\fd104265242f4376\services\Konstrukt.Service.Data\DataService\DataService.csproj]
The solution is simple, just pass in a boolean. If you are passing in anything after –self-contained you have to set the boolean explicitly (see issue here) :