All Articles

How to disable web.config transforms with .net core

I had a small problem that the web.config of the eTender Messenger was overwritten with every new dotnet publish command. Because of this, we had to take care to exclude the published config with every deployment to production. The solution was very simple, but took some researching on the internet. You can add the following MS Build property to your csproj to prevent overwriting your web.config:

<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>

In this aspnet github issue the setting is confusingly called IsWebConfigTransformEnabled, but in my setup (Visual Studio Code on OSX, .net core 2.0) adding this property does not work and I had to use IsTransformWebConfigDisabled ;-).

Published 2 Jun 2018

A blog about .net core and full stack web development.
Peter Dolon GitHub