TFS msbuild args /p:DeployOnBuild=true doesn't seem to do anything -


i'm using tfs , regular build process activity build solution. however, i'd able automate deployment can build , deploy remotely server in 1 step.

on msbuild arguments trying specify deployment switch. project windows service, understand still possible deploy binaries regardless of project type (not being web project).

current build parameters:

/p:deployonbuild=true /p:username=user /p:password=password 

when build runs in tfs succeeds, expecting see attempt @ deployment server , helpful error message nothing shows.

for future reference, i've found required enable deployments other web services/projects. reason deployonbuild parameter doesn't anything other web projects project file needs include webapplication.targets , propertygroup containing path vstoolspath.

this link here gave me introduction how web deployments work , how integrate project deploy services:

http://www.asp.net/web-forms/tutorials/deployment/web-deployment-in-the-enterprise/building-and-packaging-web-application-projects

1) pass parameters msbuild need .pubxml file (called publishing profile) within publishprofiles folder under project properties folder.

2) needed following in .csproj file:

  <propertygroup>     <visualstudioversion condition="'$(visualstudioversion)' == ''">11.0</visualstudioversion>     <vstoolspath condition="'$(vstoolspath)' == ''">$(msbuildextensionspath32)\microsoft\visualstudio\v$(visualstudioversion)</vstoolspath>   </propertygroup>    <import project="$(msbuildtoolspath)\microsoft.csharp.targets" />   <import project="$(vstoolspath)\webapplications\microsoft.webapplication.targets" condition="'$(vstoolspath)' != ''" />   <import project="$(msbuildextensionspath32)\microsoft\visualstudio\v11.0\webapplications\microsoft.webapplication.targets" condition="false" /> 

3) if need pre-sync/post-sync commands of msdeploy, unfortunately not available msbuild. achieve functionality need have x.wpp.targets (where x project name) inside project root folder.

<project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    <target name="uninstallservice" beforetargets="msdeploypublish">            <!-- exec tasks here -->    </target>    <target name="installservice" aftertargets="msdeploypublish">            <!-- exec tasks here -->    </target>  </project> 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -