visual-studio 我如何获得 msbuild.exe?没有安装VS2008 可以构建.vcproj 吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1415497/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 11:00:28  来源:igfitidea点击:

How do I get msbuild.exe? Can it build a .vcproj when VS2008 is not installed?

visual-studiomsbuildvcproj

提问by Cheeso

I know msbuild will be installed, if I install Visual Studio 2005 or 2008.

我知道如果我安装 Visual Studio 2005 或 2008,将会安装 msbuild。

I know msbuild is also installed if I install the .NET Framework SDK.

我知道如果我安装了 .NET Framework SDK,也会安装 msbuild。

As of .NET 3.0, I think there is no longer a separate ".NET Framework SDK". Instead if I want the free SDK stuff - all the .NET command line tools, all the base class libraries - then I can download the Windows SDK, and install the .NET portion of it. I will also get the msbuild tool if I do this. (Right?)

从 .NET 3.0 开始,我认为不再有单独的“.NET Framework SDK”。相反,如果我想要免费的 SDK 东西——所有 .NET 命令行工具、所有基类库——那么我可以下载 Windows SDK,并安装它的 .NET 部分。如果我这样做,我也会得到 msbuild 工具。(对?)

Now to my questions:

现在我的问题:

  1. Will I get msbuild if I install one or more parts of the Windows SDK that does not include the .NET SDK?

  2. Will I get nmake, too?

  3. If I don't have Visual Studio installed, will MSBuild be able to build a .sln file that references a .vcproj file? I know msbuild can build .vbproj and .csproj, but can it build .vcproj? I also think that for VS2010, the .vcproj file changes to the ".csproj format". But this is a .vcproj from vs2008.

  1. 如果我安装一个或多个不包含 .NET SDK 的 Windows SDK 部分,我会得到 msbuild 吗?

  2. 我也会得到nmake吗?

  3. 如果我没有安装 Visual Studio,MSBuild 是否能够构建一个引用 .vcproj 文件的 .sln 文件?我知道 msbuild 可以构建 .vbproj 和 .csproj,但它可以构建 .vcproj 吗?我也认为对于 VS2010,.vcproj 文件更改为“.csproj 格式”。但这是来自 vs2008 的 .vcproj。



I am distributing some source code and I want to describe what is required to build the source. I know the source can be built with VS 2008. I want to also describe how it can be built without VS2008.

我正在分发一些源代码,我想描述构建源代码所需的内容。我知道可以使用 VS 2008 构建源代码。我还想描述如何在没有 VS2008 的情况下构建它。

Thanks.

谢谢。

回答by Jon Skeet

  1. msbuildis installed with the framework itself, not just the SDK. So you don't need to download any SDKs.
  2. No, you won't get nmakeat the same time.
  3. Yes, you'll be able to build solution and project files without Visual Studio being installed.
  1. msbuild与框架本身一起安装,而不仅仅是 SDK。因此您无需下载任何 SDK。
  2. 不,你不会同时得到nmake
  3. 是的,您将能够在不安装 Visual Studio 的情况下构建解决方案和项目文件。

Admittedly I've never triedany of these things (as I always have VS installed) but my understanding is that the above is correct.

诚然,我从未尝试过任何这些东西(因为我总是安装 VS),但我的理解是上述内容是正确的。

回答by Sayed Ibrahim Hashimi

As Jon stated MSBuld is installed with the .NET framework. To build managed projects you don't need Visual Studio, but to build .vcproj files you will have to have Visual Studio installed. With Visual Studio 2010 .vcproj files are MSBuild files so this requirement is lifted.

正如 Jon 所说,MSBuld 是随 .NET 框架一起安装的。要构建托管项目,您不需要 Visual Studio,但要构建 .vcproj 文件,您必须安装 Visual Studio。对于 Visual Studio 2010,.vcproj 文件是 MSBuild 文件,因此取消了此要求。

回答by Cheeso

You can build .vcproj files with MSBuild 2.0/3.5 without VS installed. If you don't have VS, you need the appropriate Windows SDK installed. Either will work.

您可以在未安装 VS 的情况下使用 MSBuild 2.0/3.5 构建 .vcproj 文件。如果您没有 VS,则需要安装相应的 Windows SDK。要么会起作用。