Publish doesn't work from build definition VS2012

心不动则不痛 提交于 2019-12-11 01:43:31

问题


What I thought would be simple is not. All I am trying to do is get MSBuild to copy website files to another server after my build.

In my Build definition Under Process --> Advance --> MSBuild Arguments I put

/p:DeployOnBuild=true /p:PublishProfile=WebsiteProfile

It builds fine but it never copies files to destination

BUT when I run this command locally, IT WORKS!!!!!

msbuild /p:DeployOnBuild=true /p:PublishProfile=WebsiteProfile

I have VS 2012 installed in Build Server so I think all the necessary files are there.

What is the problem?

UPDATE 1

Output in build log file

Run MSBuild for Project

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;"

REPRODUCTION STEPS

  1. Created new website project
  2. Made sure it worked on local machine using development server
  3. Checked code in TFS
  4. Created a build definition using all the default settings Under the Process --> Advance --> MSBuild Arguments I put

/p:DeployOnBuild=true /p:PublishProfile=WebsiteProfile

The publish profile copies the changeset to a remote server.


回答1:


Installing the Web Tools 2012.2 update on the build server fixed this issue for me after I read this post and Scott Gu's Blog. I don't have Visual Studio installed on the server but installing the update got my DeployOnBuild working. I hope that helps.



来源:https://stackoverflow.com/questions/17734694/publish-doesnt-work-from-build-definition-vs2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!