如何在不安装Visual Studio 2012的情况下使用MsBuild在生成服务器上生成Visual Studio 2012发布配置文件 [英] How to build Visual Studio 2012 Publishing Profiles on a Build Server with MsBuild without installing Visual Studio 2012

查看:111
本文介绍了如何在不安装Visual Studio 2012的情况下使用MsBuild在生成服务器上生成Visual Studio 2012发布配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通读了这里的许多帖子,但从未找到有效的明确答案.因此,在花了一些时间使它生效之后,我想应该将其发布.

I read through many of the posts on here and never found a clear answer that worked. So after spending the time getting this to work, I figured I should post it.

问题:发布配置文件将建立在服务器上,但不会发布.

Problem: The publishing profile would build on the server, but would not publish.

解决方案:

  1. 确保已安装 Microsoft Windows SDK和.Net Framework 4

从安装了Visual Studio 2012 Update 2的客户端计算机上,复制:

From your client machine with Visual Studio 2012 update 2 installed, copy:

\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\Web\
\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\WebApplications\

到服务器上的相同位置.

To the same location on your server.

然后创建一个简单的批处理文件:

Then make a simple batch file:

"C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ msbuild.exe"/v:diag YOUPROJECT.sln/p:配置=调试/p:DeployOnBuild = true /p:PublishProfile =您的个人资料

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" /v:diag YOUPROJECT.sln /p:Configuration=Debug /p:DeployOnBuild=true /p:PublishProfile=YOURPROFILE

这在多个构建服务器上为我们工作.

This is working for us on multiple build servers.

我希望这对某人有帮助.

I hope this helps someone.

对我来说,微软没有提供所有发布选项的MSBuild更新似乎让我发疯.在我看来,命令行工具在服务器上更为重要....

It seems insane to me that Microsoft hasn't provided a MSBuild update with all the publishing options. It seems to me that the command line tools are more important on the server....

欢呼

推荐答案

只需将Dave的解决方案移到答案中即可.

Just moving Dave's solution into an answer.

解决方案:

Solution:

  1. 确保已安装 Microsoft Windows SDK和.Net Framework 4

从安装了Visual Studio 2012 Update 2的客户端计算机上,复制:

From your client machine with Visual Studio 2012 update 2 installed, copy:

\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\Web\
\Program Files(x86)\MSBuild\Microsoft\Visual Studio\v11.0\WebApplications\

到服务器上的相同位置.

To the same location on your server.

然后创建一个简单的批处理文件:

Then make a simple batch file:

"C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ msbuild.exe"/v:diag YOUPROJECT.sln/p:配置=调试/p:DeployOnBuild = true /p:PublishProfile =您的个人资料

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" /v:diag YOUPROJECT.sln /p:Configuration=Debug /p:DeployOnBuild=true /p:PublishProfile=YOURPROFILE

这在多个构建服务器上为我们工作.

This is working for us on multiple build servers.

这篇关于如何在不安装Visual Studio 2012的情况下使用MsBuild在生成服务器上生成Visual Studio 2012发布配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆