如何从使用Windows SDK 7.1的命令行运行的MSBuild? [英] How do I run msbuild from the command line using Windows SDK 7.1?

查看:939
本文介绍了如何从使用Windows SDK 7.1的命令行运行的MSBuild?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设立我们的CI服务器上的.NET 4.0的支持。我已经从Windows 7.1 SDK安装了.NET 4.0和.NET工具。

I'm setting up .NET 4.0 support on our CI server. I've installed .NET 4.0, and the .NET tools from the Windows 7.1 SDK.

在.NET 2.0和3.5,这只是工作。在.NET 4中,当我运行从开始菜单中的Windows SDK 7.1命令提示符,它抱怨

On .NET 2.0 and 3.5, that just worked. With .NET 4, when I run the "Windows SDK 7.1 Command Prompt" from the Start menu, it complains about

The x86 compilers are not currently installed. x86-x86
Please go to Add/Remove Programs to update your installation.
.
Setting SDK environment relative to C:\Program Files\Microsoft
SDKs\Windows\v7.1
\.
Targeting Windows Server 2008 x86 Debug

然后,当我尝试运行的MSBuild,我得到:

Then when I try to run msbuild, I get:

C:\Program Files\Microsoft SDKs\Windows\v7.1>msbuild
'msbuild' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Microsoft SDKs\Windows\v7.1>

我不是很相信,在安装运行时和SDK会留下无法运行的MSBuild系统......我错过了一些明显的步骤,或模糊的Windows更新,或者是放弃的时候,并开始黑客系统路径?

I can't quite believe that installing the runtime and SDK will leave you with a system that can't run msbuild... have I missed some obvious step or obscure Windows Update, or is time to give up and start hacking the system path?

推荐答案

要启用的MSBuild在命令提示符下,你只需要在路径添加到.NET4框架安装到机器上的PATH环境变量。

To enable msbuild in Command Prompt, you simply have to add the path to the .Net4 framework install on your machine to the PATH environment variable.

您可以通过右键点击计算机上访问的环境变量,点击属性,然后点击左侧导航栏上的高级系统设置。在接下来的对话框中,单击环境变量,向下滚动到路径,并对其进行编辑,包括您的路径框架(不要忘了一个';'在这里的最后一个条目后

You can access the environment variables by right clicking on 'Computer', click 'properties' then click 'Advanced system settings' on the left navigation bar. On the next dialog box click 'Environment variables,' scroll down to 'PATH' and edit it to include your path to the framework (don't forget a ';' after the last entry in here.

有关引用我的路径是C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319

For reference my path was C:\Windows\Microsoft.NET\Framework\v4.0.30319.

这篇关于如何从使用Windows SDK 7.1的命令行运行的MSBuild?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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