4
votes

I need some advice on configuring TFS Build to work with MSBuild and a Publish Profile via File System to deploy my web app...

I'm using TFS 2013 and Visual Studio 2013. I have a Web Application project with a few class library projects. I have a web.config transform for our Dev and QA environments. I have Publish Profiles defined that are doing a File System deploy. These Publish Profiles work in Visual Studio. These same Publish Profiles work if I open the command line and execute MSBuild using the following commands:

/p:DeployOnBuild=true /p:PublishProfile="Dev Intranet"

I've created a TFS Build Definition and all of the builds report that they are successful. I've configured the MSBuild Arguments with the same parameters as executing MSBuild from the command line.

I'm expecting the Publish Profile to copy the PublishedWebsite to a folder on my network, but this isn't happening.

For testing purposes, I set the TFS Build drop folder to the same network location. All of those files show up including a "_PublishedWebsite" directory. But I can not use this directory because the web.config isn't transformed.

I've found several websites that suggest that this is possible, but I've yet to have any success. If anybody has gotten this to work, I'd appreciate some help.

MSDN: Create a Build Definition

AwaitWisdom: Automatic Web Deployment with TFS Team build

2

2 Answers

2
votes

The issue was that MSBuild was never executing the Publish Profile.

In order to use Publish Profiles on the build server, you have to have some of Visual Studio's prerequisites. I haven't identified exactly which ones, but installing Visual Studio fixed the issue.

0
votes

if you want packages while building please refer https://sivapalla.wordpress.com/2015/05/29/web-config-transformation-in-build-tfs/

option 1 : In publish profile mention share path option 2: In build definition Post build activity you can copy.