本文转自;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

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

  1. Run Nutch In Eclipse on Linux and Windows nutch version 0.9

    Running Nutch in Eclipse Here are instructions for setting up a development environment for Nutch un ...

  2. Availability-group DDL operations are permitted only when you are using the master database. Run the USE MASTER command, and retry your availability-group DDL command.

    Question: SQL SERVER  alwayson在向AG中添加DB最后一步在副本中将此DB添加入AG时报错: Availability-group DDL operations are p ...

  3. Always run a program in administrator mode in Windows 10

    From: https://www.cnet.com/how-to/always-run-a-program-in-administrator-mode-in-windows-10/ If you'r ...

  4. 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 ...

  5. [Node] Run Local DevDependencies from the Command Line with npx

    In the past, you've needed to either write a package.json script or use the node_modules/.bin direct ...

  6. 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 h ...

  7. Cygwin Run in the Windows(Simulation of UNIX)

    Preface Environment Cygwin Run in the Windows(Simulation of UNIX) Resource Cygwin Install:http://cyg ...

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

    Threejs 官网 - 怎样执行本地的东西(How to run things locally) 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循&qu ...

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

    本文转自:https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications- ...

随机推荐

  1. 二、jdk命令之javah命令(C Header and Stub File Generator)

    目录 一.jdk工具之jps(JVM Process Status Tools)命令使用 二.jdk命令之javah命令(C Header and Stub File Generator) 三.jdk ...

  2. postman-2get发送请求

    文档地址:https://www.v2ex.com/p/7v9TEc53 第一个API请求 最热主题 相当于首页右侧的 10 大每天的内容. https://www.v2ex.com/api/topi ...

  3. Python请求外部POST请求,常见四种请求体

    原文http://blog.csdn.net/silencemylove/article/details/50462206 HTTP 协议规定 POST 提交的数据必须放在消息主体(entity-bo ...

  4. Android TextView(EditView)文字底部或者中间 加横线

    Android TextView(EditView)文字底部或者中间 加横线 tv = (TextView) this .findViewById(R.id. text_view ); 中间加横线 t ...

  5. 读到的"关于授权"

    关于授权 记得公司刚有十几个人的时候,全公司我最忙,经常同时接两三个销售电话,还得安排送货,结账,进货,每天来得最早,走得最晚.一次我弟弟到公司,看了半天,发表感慨说:"哥我怎么觉得你在养活 ...

  6. 跟我学算法-人脸识别(Siamese network) 推导

    Siamese network 训练神经网络存在两种形式: 第一种:通过Siamese network 和 三元组损失函数 来训练图片之间的间隔 第二种: 通过Siamese network 和 si ...

  7. 通过nginx + lua来统计nginx上的监控网络请求和性能

    介绍 以前我们为nginx做统计,都是通过对日志的分析来完成.比较麻烦,现在基于ngx_lua插件,开发了实时统计站点状态的脚本,解放生产力. 项目主页: https://github.com/sky ...

  8. 使用BMFont

    [使用BMFont] 参考1说明如何根据ttf字体生成fnt.png. 参考2说明如何根据自定义图片生成fnt.png. 分三步: 1.Edit->Open Image Manager.导入需要 ...

  9. solr dismax与edismax的参数列表

    dismax q.alt qf (Query Fields) mm (Minimum 'Should' Match) pf (Phrase Fields) ps (Phrase Slop) qs (Q ...

  10. js 倒计时功能,获取当前时间的年月日,时分秒

    一.实现当前时间到指定截止时间的倒计时功能 <html> <head> <title>TEST</title> </head> <bo ...