本文转自;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. Phonegap 工作原理

    1.Phonegap是什么 PhoneGap 是一个基于HTML和JavaScript的应用开发平台,使用它可以构建本地应用.你可以把PhoneGap看作一个正方形的web view containe ...

  2. Ionic 项目创建

    1. Ionic介绍 Ionci 是一个强大的HTML5 应用程序框架. 可以帮助您使用Web技术,如HTML, CSS和Javascript构建原生体验的移动应用程序. Ionic主要关注外观和体验 ...

  3. maven库 mvn依赖

    http://maven.outofmemory.cn/ http://mvnrepository.com/ 先执行 mvn clean  然后执行  mvn 命令 如:mvn  compile  . ...

  4. bzoj2505: tickets

    Description          有一位售票员给乘客售票,对于每位乘客,他会卖出多张连续的票,直到已卖出的编号的所有位置上的数的和不小于给定的正数k.然后他会按照相同的规则给下一位乘客售票.初 ...

  5. Linux C 一些函数 所属的头文件

    在编写程序时,有时总是不记得所使用的函数在哪个库函数中.现在先把自己以前经常用到的函数头文件总结一下. 有不对的地方还请指教. 1,系统调用文件的操作函数 #inlclude <fcntl.h& ...

  6. python HTMLTestRunner.py

    Mac下HTMLTestRunner.py存放路径: -/anaconda/lib/python3.6/site-packages/HTMLTestRunner.py 已经更改,python3可以直接 ...

  7. 解决Linux下MySQL登录ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor)问题

    两种方案: 一: 1.修改mysql配置文件:vim /etc/my.cnf 2.找到[mysqld]下添加 skip-grant-tables 配置 3.重启服务service mysqld res ...

  8. IBM X3650 M4 主板故障

    故障描述: 今天突然接到报警,一台服务器无法连通,无法登录.无法 ping 通. 打电话到 IDC ,授权工程师查看服务器状态,返回结果如下: 1.服务器关机状态 2.无法开机 ( 电源灯亮 ),按开 ...

  9. Apache Hadoop 集群安装文档

    简介: Apache Hadoop 集群安装文档 软件:jdk-8u111-linux-x64.rpm.hadoop-2.8.0.tar.gz http://www.apache.org/dyn/cl ...

  10. http post Content-type: application/json; charset=utf-8

      The header just denotes what the content is encoded in. It is not necessarily possible to deduce t ...