TeamCity .NET CLI publish do not overwrite web.config

Completed

I am building an ASP.NET Core web service in TeamCity using the .NET CLI client.

I use a publish build step to create the deploy package.

For some reason this step ignores the web.config present in app root.

Instead it creates its own barebones web.config

Is it possible to force the publish step to use the web.config present in app root ?

0
1 comment
Avatar
Fedor Rumyantsev

Could you please confirm the expected behavior? What happens to the existing web.config if you run the command manually? (please check this article if manual execution is good: https://www.jetbrains.com/help/teamcity/2019.1/common-problems.html#CommonProblems-BuildworkslocallybutfailsormisbehavesinTeamCity)

Generally speaking, TeamCity is just calling the dotnet publish command and does not affect how existing web.config will be handled. This MSDN article hints that web.config at application root after publish step would be a result of transformations applied to bare config, if any: https://docs.microsoft.com/ru-ru/aspnet/core/host-and-deploy/iis/transform-webconfig?view=aspnetcore-3.1

0

Please sign in to leave a comment.