[转]How do I run msbuild from the command line using Windows SDK 7.1?

本文转自;http://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1

Q:

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.

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

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>

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?

A1:


173down voteaccepted

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

You can access the environment variables by:

  1. Right clicking on Computer
  2. Click Properties
  3. Then click Advanced system settings on the left navigation bar
  4. On the next dialog box click Environment variables
  5. Scroll down to PATH
  6. Edit it to include your path to the framework (don‘t forget a ";" after the last entry in here).

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

A2:

From Visual Studio 2013 onwards, MSbuild comes as a part of Visual Studio. Earlier, MSBuild was installed as a part of. NET Framework.

MSBuild is installed directly under %ProgramFiles%. So, the path for MSBuild might be different depending on the version of Visual Studio.

For Visual Studio 2015, Path of MSBuild is "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"

For Visual Studio 15 Preview, Path of MSBuild is "%ProgramFiles(x86)%\MSBuild\15.0\Bin\MSBuild.exe"

Also, Some new MSBuild properties has been added and some have been modified. For more information look here

Update 1: VS 2017

The location for the MSBuild has changed again with the release of Visual Studio 2017. Now the installation directory is under the %ProgramFiles(x86)%\Microsoft Visual Studio\2017\[VS Edition]\15.0\Bin\. Since, i have an Enterprise edition, the MSBuild location for my machine is

时间: 2024-10-06 03:33:02

[转]How do I run msbuild from the command line using Windows SDK 7.1?的相关文章

run loadrunner script in command line

D:\LoadRunner78\bin\mdrv.exe -usr D:\LR_Tests\C\get_attribute\get_attribute.usr -out D:\LR_Tests\C\get_attribute\out -time 1.5 -secondsInYear 30758400 -MrsCollins Charlotte

R语言连接MySQL报错:could not run statement: The used command is not allowed with this MySQL version

版本说明 R版本:3.5 MySQL版本:8.0 RMySQL版本:0.10.19 情景说明: 使用RMySQL成功连接到MySQL数据库,可以进行查询操作,但在插入时报错,提示信息如下: con <- dbConnect(MySQL(), host="127.0.0.1", dbname="epid", user="root", password="1234")dbWriteTable(con,"city_d

vue-electron 使用sqlite3数据库,执行npm run build 报错 .NET Framework 2.0 SDK,Microsoft Visual Studio 2005[C:\temp\wechat\node_modules\sqlite3\build\binding.sln]

问题描述 vue-electron 使用sqlite3数据库,执行npm run build 报错如下: .NET Framework 2.0 SDK,Microsoft Visual Studio 2005[C:\temp\wechat\node_modules\sqlite3\build\binding.sln]Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Program Files (x86)\nodejs\nod

Threejs 官网 - 怎样执行本地的东西(How to run things locally)

Threejs 官网 - 怎样执行本地的东西(How to run things locally) 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致"创作公用协议 转载请保留此句:太阳火神的漂亮人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS.Android.Html5.Arduino.pcDuino,否则.出自本博客的文章拒绝转载或再转载,谢谢合作. 怎样执行本地的东西(How to run th

How to run an manually installed program from terminals in Linux / Ubuntu

Say we have installed qt programs and we want to run qtcreator from the command line. What we need here is only to put a soft link to the qtcreator we have just installed. Here are some simple precedures. Once the Qt program is installed, open up a t

Threejs 官网 - 如何运行本地的东西(How to run things locally)

太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一致"创作公用协议 转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS.Android.Html5.Arduino.pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作. 如何运行本地的东西(How to run things locally) nme01 edited this page on 26 Nov 201

[转]Publishing and Running ASP.NET Core Applications with IIS

本文转自:https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications-with-IIS#DoyouneedIIS? When you build ASP.NET Core applications and you plan on running your applications on IIS you'll find that the way that Core ap

Play framework 2.5新建工程执行日志

[info] [info] --- (Running the application, auto-reloading is enabled) --- [info] [info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000 [info] [info] (Server started, use Ctrl+D to stop and go back to the console...) [info] [info] Stopping Play f

Microsoft Build 2016

Microsoft Build 2016 Day 1 记录 去年今日:Microsoft Build 2015 汇总 今年的 Bulid 时间是 3.30-4.1,第一天的主角主要是 Windows 10.人工智能.HoloLens.小娜等,详细介绍:3 分钟看完 Build2016 Day 1 Keynote,对于 .NET 开发者来说,内容相对较少,但也有一些透露出来的内容,值得我们关注,下面介绍我搜刮到的一些. 1. Visual Studio “15” Preview and VS 20