Error MSB4030 when building self-contained apps
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) :
<img class="aligncenter size-full wp-image-38793" src="https://inlovewithcode.azureedge.net/wp-content/uploads/2019/12/Error-MSB4030-Teamcity.png" alt="Error MSB4030 Teamcity" width="817" height="744" />
Last modified on 2019-11-30