当前位置: 动力学知识库 > 问答 > 编程问答 >

deployment - TFS Web Deploy doesn't execute via Build but executes locally?

问题描述:

I have a solution that I am trying to get TFS 2010 to deploy after it builds.

When I run the following msbuild command locally, it deploys fine:

msbuild C:\Path\to\Solution.sln /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=https://[Server]:8172/MsDeploy.axd /p:DeployIisAppPath="TestSite" /p:UserName=Domain\Username /p:Password=NotTheRealPassword /P:AllowUntrustedCertificate=True

However, when I stick those same options into the TFS 2010 build MS Build arguments:

...it doesn't appear to execute anything.

The build finishes correctly:

But I see nothing in the entire log file related to deployment, etc. It's as if the parameters were never even passed in to MSBuild from TFS.

The MSBuild Command Being Called by TFS

The log has it as (scrubbed sensitive data): C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /noconsolelogger "C:\Builds\1\[Scrubbed]\Daily6am\Sources\[Scrubbed].sln" /m:1 /fl /flp:"logfile=C:\Builds\1\[Scrubbed]\[Scrubbed]\Sources\[Scrubbed].log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=https://[Scrubbed]:8172/MsDeploy.axd /p:DeployIisAppPath="TestSite" /p:UserName=[Scrubbed]\farmservice /p:Password=[Scrubbed] /p:AllowUntrusted=True /P:AllowUntrustedCertificate=True /p:OutDir="C:\Builds\1\[Scrubbed]\[Scrubbed]\Binaries\\" /p:Configuration="Debug" /p:Platform="Any CPU" /p:VCBuildOverride="C:\Builds\1\[Scrubbed]\[Scrubbed]\Sources\[Scrubbed].sln.Any CPU.Debug.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/23;InformationNodeId=4504;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://[Scrubbed]:8080/tfs/[Scrubbed]_Collection;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;"

Questions

  • How can I get TFS to tell MSBuild to build the deployment?
  • How can I verify whether the parameters were even passed in?
  • How can I correctly read the logs to know if this has taken place or not?

Assistance on any of these would be much appreciated.

网友答案:

I was able to find the answer on a SO question from a bit ago :)

According to the answer at this SO Question, @marvc1 (credit where it's due) suggested copying the following files:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications

I had copied WebApplications, but not Web. Copying web resolved the issue.

分享给朋友:
您可能感兴趣的文章:
随机阅读: