问题描述
当我在本地运行以下msbuild命令时,它会部署好:
我有一个解决方案,我试图让TFS 2010部署后, / p>
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 /警:AllowUntrustedCertificate =真
然而,当我坚持这些相同的选项加入到TFS 2010构建MS建立参数:
...似乎没有执行任何操作。
构建正确完成:
但是,在整个日志文件中没有看到与部署相关的信息等等。就好像参数从TFS起,甚至没有进入MSBuild。
TFS调用的MSBuild命令
日志有它作为(擦除敏感数据): C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe / nologo / noconsoleloggerC:\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:Deplo yIisAppPath =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:WorkflowCentralLoggerC:\Program Files\Microsoft Team Foundation Server 2010\Tools\\ \\Microsoft.TeamFoundation.Build.Server.Logger.dll ; 冗长=正常; BuildUri = vstfs:///构建/建造/ 23; InformationNodeId = 4504; TargetsNotLogged = GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath; TFSUrl = HTTP:// [Scrubbed]:8080 / tfs / [Scrubbed] _Collection;* WorkflowForwardingLoggerC:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll; Verbosity = Normal;
问题
- 如何让TFS告诉MSBuild构建部署?
- 如何验证参数是否甚至通过了?
- 如何正确读取日志,以确定是否发生了这种情况?
对这些中的任何一个的帮助将不胜感激。
我能够在SO上找到答案从比特前的问题:)
根据在,(信用到达)建议复制以下文件:
-
C:\\ \\ Program Files(x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
-
C:\\ \\ Program Files(x86)\MSBuild\Microsoft\\ VisualStudio\v11.0\WebApplications
我抄袭了web应用,而不是网站。复制网络解决了这个问题。
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.
这篇关于TFS Web Deploy不通过Build执行,但是在本地执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!