我认为很简单的事情并非如此。我要做的就是让 MSBuild 在构建后将网站文件复制到另一台服务器。
在我的构建定义中,在Process --> Advance --> MSBuild Arguments我把
/p:DeployOnBuild=true /p:PublishProfile=WebsiteProfile
它构建得很好,但它从不将文件复制到目标
但是当我在本地运行这个命令时,它可以工作!!!!!!
msbuild /p:DeployOnBuild=true /p:PublishProfile=WebsiteProfile
我在 Build Server 中安装了 VS 2012,所以我认为所有必要的文件都在那里。
问题是什么?
更新 1
构建日志文件中的输出
为项目运行 MSBuild
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /noconsolelogger "C:\Builds\1\MyProject\MyProject\src\MyProject.sln" /nr:False /fl /flp:"logfile=C:\Builds\1\MyProject\MyProject\src\MyProject.log;encoding=Unicode;verbosity=detailed" /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:PublishProfile=WebsiteProfile /p:VisualStudioVersion=11.0 /m /p:OutDir="C:\Builds\1\MyProject\MyProject\bin\\" /p:RunCodeAnalysis="False" /p:VCBuildOverride="C:\Builds\1\MyProject\MyProject\src\MyProject.sln.vsprops" /dl:WorkflowCentralLogger,"E:\Microsoft Team Foundation Server 11.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Detailed;BuildUri=vstfs:///Build/Build/64;InformationNodeId=20178;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://abc-tfs-p:8080/tfs/defaultcollection;"*WorkflowForwardingLogger,"E:\Microsoft Team Foundation Server 11.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Detailed;"
复制步骤
- 创建了新的网站项目
- 确保它使用开发服务器在本地机器上工作
- TFS 中的检查代码
- 使用所有默认设置创建了一个构建定义在我输入的 Process --> Advance --> MSBuild Arguments 下
/p:DeployOnBuild=true /p:PublishProfile=WebsiteProfile
发布配置文件将变更集复制到远程服务器。