Kyle W
Kyle W

Reputation: 3752

Transform web.config with TFS Build Server 2015

I'm looking to create a deployment artifact using TFS Build Server 2015. I have my web application building, and it looks like everything I need is in the /bin folder, but it's not applying the transforms that are normally applied if I go into Visual Studio and Publish the website.

How do I get the build to use the transforms defined?

Upvotes: 1

Views: 1613

Answers (2)

Abacus
Abacus

Reputation: 2109

The answer is at: Using msbuild to execute a File System Publish Profile

It's the 2nd answer, from @P. Roe. It doesn't really answer the question of that page, which is why it wasn't marked as correct, but it is the answer to your question (which was also mine).

Additionally, after doing that, I found that my connection strings were lost in the transform of the web.config. The solution to that problem is at: ReplacableToken_ when using web.config transform?

Upvotes: 0

s3raph86
s3raph86

Reputation: 566

It's hard to say without knowing more about your release process, and what output you're expecting. I'm assuming that you're not using /t:Package to build a web deploy package here.

The web.config transforms normally are only applied during the process of publishing the project. In order to force the transformation behaviour, I believe you can specify the following arguments in your call to msbuild.

/p:UseWPP_CopyWebApplication=true;PipelineDependsOnBuild=false

If you do want to publish, you'll want to run:

msbuild your.sln /p:DeployOnBuild=true;PublishProfile=yourpublishprofilename

Upvotes: 1

Related Questions