生成服务器上的MSBuild 2015环境变量 [英] MSBuild 2015 environment variables on build server

查看:381
本文介绍了生成服务器上的MSBuild 2015环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设置用于构建VS2015应用程序的构建代理.我不想在代理上安装所有Visual Studio,因此我安装了Microsoft Build Tools2015.但是,为了使我的构建正常工作,我需要加载许多环境变量 在Visual Studio命令提示中设置的内容.在我自己的计算机上(安装了VS2015的计算机上),在构建之前,请在命令提示符下运行vsvars32.bat.但是,在构建代理上,vsvars32.bat在以下位置不存在:
C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ Tools \
(实际上,整个文件夹是空的)

I am setting up a build agent for building VS2015 applications. I do not want to install all of Visual Studio on the agent, so I installed Microsoft Build Tools 2015. In order for my build to work, however, I need to load many of the environment variables that are set in a Visual Studio command prompt. On my own machine (where VS2015 is installed) I run vsvars32.bat on a command prompt before building. On the build agent, however, vsvars32.bat does not exist in:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
(in fact, the whole folder is empty)

我还需要在服务器上安装其他软件吗?还是有另一种方法来填充所有环境变量?还是我需要复制整个Tools文件夹? (它是独立的吗?)

Is there something else I would need to install on the server? Or is there another way of getting all the environment variables populated? Or perhaps I need to copy over the entire Tools folder? (is it self-contained?)

推荐答案

菲利普,

感谢您在MSDN论坛中发帖.

Thank you for posting in MSDN forum.

>>我还需要在服务器上安装其他软件吗?

对于此问题,还取决于您针对.Net Framework版本的程序.

For this question, it also depends on your program targeting .Net Framework version.

或示例,如果该应用程序针对.Net Framework 4.6,则需要安装:

or example, if the app targets .Net Framework 4.6, you need to install:

然后调用其他版本的MsBuild来构建您的解决方案:

Then call a different version of MsBuild to build your solution:

C:\ Program Files(x86)\ MSBuild \ 14.0 \ Bin \ MsBuild.exe MySolution.sln

C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe MySolution.sln

请注意,这可能不包含Visual Studio附带的所有位和sdk,因此您可能会遇到丢失"的情况. .targets个文件"或在构建应用程序时遇到其他问题.其他SDK可以缓解该问题:

Note, this may not contain all bits pieces and sdk's that ship with Visual Studio, so you may encounter "missing .targets files" or other problems building your application. Other SDKs may alleviate that problem:

文件"vsvars32.bat"可以在以下路径中找到: C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ bin

The file "vsvars32.bat" can be found at path:  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

最好的问候


这篇关于生成服务器上的MSBuild 2015环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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