I am trying to deploy my web application automatically at the end of the automatic build, and I obviously missed something.
My setup:
VS2012 on Win7 Workstation
TFS2010 repository on the server
TFS build agent on serverb
Test site in IIS7 on server C.
I created a quick test project using the default MVC4 template and created a Team Project to use it using the MS VS Scrum 1.0 template.
I created a new publish profile for the web application using the publish dialog, and the .pubxml file is checked with the project. Pubxml looks something like this:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>MSDeploy</WebPublishMethod> <SiteUrlToLaunchAfterPublish>TestServer/DeployTest</SiteUrlToLaunchAfterPublish> <MSDeployServiceURL>http://TestServer</MSDeployServiceURL> <DeployIisAppPath>webapp-dev/DeployTest</DeployIisAppPath> <RemoteSitePhysicalPath /> <SkipExtraFilesOnServer>False</SkipExtraFilesOnServer> <MSDeployPublishMethod>RemoteAgent</MSDeployPublishMethod> <UserName>mydomain\myuser</UserName> <_SavePWD>True</_SavePWD> <PublishDatabaseSettings> <Objects xmlns="" /> </PublishDatabaseSettings> </PropertyGroup> </Project>
* some names have been changed to protect the innocent :)
Using this profile, I can successfully publish a Visual Studio application to a test web server without any problems. Following the Scott Hanselman blog post, I successfully posted from the command line on my workstation:
msbuild DeployTest.csproj / p: DeployOnBuild = true / p: PublishProfile = Test / p: AllowUntrustedCertificate = true / p: Password = notTheRealPassword
Then I created an assembly in Team Explorer that will use my assembly server to compile and then run unit tests. Things are good. Projects are being built, module tests are underway.
Then I added parameters from the command line to MS Build Arguments in the extended section of the assembly definition:
/ p: DeployOnBuild = true / p: PublishProfile = Test / p: AllowUntrustedCertificate = true / p: Password = notTheRealPassword
Build runs, unit tests pass, nothing is published on the web server. :(
Can someone enlighten me about what I missed? Nothing I read seems to indicate the step I skipped, but there would seem to be very little documentation to explain how this is done.