简体   繁体   中英

MSDeploy after TFS Build not firing

I am trying to start a deploy after my TFS build succeeds. I am supplying the following parameters to the MSBuild Arguments

/P:AllowUntrustedCertificate=True /p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=WMSVC
/p:MSDeployServiceUrl= https://server.test.com
/p:DeployIisAppPath="website" /p:UserName=username /p:Password=password

The Build runs smoothly, however, the Deploy never actually happens. In my Drop folder, a temp folder called _PublishedWebsites gets added, but the contents of that folder aren't pushed to the Web Server.

I have WebDeploy 3.0 installed on my build server, as well as VS 2012 and TFS 2012. I am able to send a deploy through VS 2012 on my local instance with no issue, using WebDeploy. I am not sure what I am missing, but it must be something small to trigger the Deploy.

I had this problem where my Bin would build & deploy fine, but no website would be created in the Drop tree. Tried lots of things for a couple of days and finally arrived at a change to the project file as the solution.

My Websites to be deployed were originally WebSite projects in VS2008 and were converted to WebApplication projects later in VS2012. In the csproj file (and/or vbproj file) I found the following section:

<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />

I replaced that with the following, which I gleaned from a newly-created MVC app:

  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
  <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
    <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
  </Target>

This defines the variables and sets the build targets so the automated build picks them up. No idea why the WebApplication conversion process missed these. Make sure you replace 'VisualBasic' with 'CSharp' if your project is not VB. Also, you may need to use v10.0 instead of v11.0 depending on the configuration of your build server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM