发布不适用于版本定义VS2012 [英] Publish doesn't work from build definition VS2012
问题描述
我认为简单的不是.我要做的就是让MSBuild在构建后将网站文件复制到另一台服务器.
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.
在我的构建定义中的处理-> 高级-> MSBuild参数中,我放置
In my Build definition Under Process --> Advance --> MSBuild Arguments I put
/p:DeployOnBuild = true/p:PublishProfile = WebsiteProfile
/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
msbuild /p:DeployOnBuild=true /p:PublishProfile=WebsiteProfile
我在Build Server中安装了VS 2012,所以我认为所有必需的文件都在其中.
I have VS 2012 installed in Build Server so I think all the necessary files are there.
出什么问题了?
更新1
在构建日志文件中输出
运行MSBuild for Project
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;"
复制步骤
- 创建了新的网站项目
- 确保它可以在本地计算机上运行 使用开发服务器
- 在TFS中检查代码
- 使用过程"->下的所有默认设置创建构建定义 进阶->我提出的MSBuild参数
- Created new website project
- Made sure it worked on local machine using development server
- Checked code in TFS
- Created a build definition using all the default settings Under the Process --> Advance --> MSBuild Arguments I put
/p:DeployOnBuild = true/p:PublishProfile = WebsiteProfile
/p:DeployOnBuild=true /p:PublishProfile=WebsiteProfile
发布配置文件将更改集复制到远程服务器.
The publish profile copies the changeset to a remote server.
推荐答案
在阅读此斯科特·顾(Scott Gu)的博客.我没有在服务器上安装Visual Studio,但是安装更新使DeployOnBuild正常工作.希望对您有所帮助.
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.
这篇关于发布不适用于版本定义VS2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!