We are setting up continuous integration with team city doing builds on check-ins. This works fine, however it always builds with default web.config, it does not transform with development environment specific web config.
In Visual Studio, I have custom build configuration created for development. The web.development.config
transforms correctly when I publish locally with development
configuration selected, but this does not happen on the build server.
In team city, as part of msbuild step I have created a build parameter sys.configuration
and I am passing development
as the value. But when it runs, the resulting web.config is not transformed with the development settings. I also tried setting the command line parameter to /p:configuration=development
with no success.
Any help will be much appreciated.
We've been using publish targets in our web application projects and had seen that the build process was correctly transforming our web.config files, but when we moved the build to our CI server, the transforms were not being applied.
The MSBuild script were using was:
MSBuild.exe PATH_TO_PROJ.csproj /p:DeployOnBuild=true /p:PublishProfile=PUBLISH_TARGET
What we found was that we still needed to specify the Configuration as Debug or Release (even though this appears to be an attribute of the publish target.)
MSBuild.exe PATH_TO_PROJ.csproj /p:DeployOnBuild=true /p:PublishProfile=PUBLISH_TARGET /p:Configuration=Release
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With