如何启动正确版本的 Msbuild [英] How to launch correct version of Msbuild

查看:26
本文介绍了如何启动正确版本的 Msbuild的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我输入时...

Msbuild<Enter>

...在命令提示符下,我得到...

...at the command prompt, I get...

Microsoft (R) Build Engine Version 2.0.50727.4927
[Microsoft .NET Framework, Version 2.0.50727.4927]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

这一切都很好,除了当我对 Visual Studio 2010 .sln 文件运行它时,错误消息指示:

This is all very well and good except that when I run this against a Visual Studio 2010 .sln file, the error message indicates:

MyProject.sln(2): Solution file error MSB5014: File format version is not recognized.  MSBuild can only read solution files between versions 7.0 and 9.0, inclusive.
0 Warning(s)
1 Error(s)

似乎正在调用的 MSBuild 版本无法理解我的解决方案文件.

It would appear that the version of MSBuild that is being called, is not capable of understanding my solution file.

我想我会检查我的路径并查看从哪里获取 MSBuild.但是,似乎我的路径中没有任何部分指向要找到 MSBuild 的位置.

I figured that I would check out my path and see where MSBuild is being picked up from. However, it seems that no part of my path points at a location where MSBuild is to be found.

命令行如何找到它正在使用的 MSBuild 副本,如何更改此版本以便使用最新版本?

How is the command line finding the copy of MSBuild that it is using and how can I change this version so that the latest version is used?

推荐答案

它必须在PATH环境中的某个地方.使用 'where msbuild' 来确定它从哪里加载 msbuild.

It must be somewhere in the PATH environment. Use 'where msbuild' to determine where it is loading msbuild from.

使用 Visual Studio 命令提示符 (2010) 快捷方式初始化 VS 2010 和 MSBuild 4.0 的路径和其他环境变量.

Use the Visual Studio Command Prompt (2010) shortcut to initialize the path and other environment variables for VS 2010 and MSBuild 4.0.

这篇关于如何启动正确版本的 Msbuild的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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