visual-studio - MSBuild 在构建解决方案时是否将项目解析为项目引用?

标签 visual-studio msbuild

MSDN 文档 Visual Studio Integration (MSBuild)状态:

Building Solutions

Within Visual Studio, the solution file and project build ordering are controlled by Visual Studio itself. When building a solution with msbuild.exe on the command line, MSBuild parses the solution file and orders the project builds. In both cases the projects are built individually in dependency order, and project to project references are not traversed. In contrast, when individual projects are built with msbuild.exe, project to project references are traversed.

在我的 Visual Studio 2010 中,当从命令行使用 MSBuild 构建一个 .sln 文件时,项目到项目的引用全部被构建,无论它们是否出现在解决方案。

我在这里错过了什么?还是文档完全错误?

最佳答案

你是正确的,msbuild.exe 将整理所有项目引用,无论它们是否是解决方案的一部分,这与在 Visual Studio 2010/2012/2013/2015(以及可能的更高版本)中构建相比,你将获得如果引用的项目不是解决方案的一部分或不是事先构建的,则构建失败。

简而言之,是的,文档似乎有点偏离。

关于visual-studio - MSBuild 在构建解决方案时是否将项目解析为项目引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34900019/

相关文章:

visual-studio - nuget.org 和 api.nuget.org 之间有什么区别

c# - visual studio 2008 部署项目可以在系统未安装.net 的情况下运行吗?

msbuild - 为什么我从 Membership.GetCurrentUserName 收到 NullReferenceException?

visual-studio - 如何在 Visual Studio 后期构建脚本中使用构建时间戳

c++ - Msbuild 和 ClCompile 选项

c++ - 当异常发生在国外源代码时,自创建的Minidump-File的Stacktrace无法正确使用

.net - Visual Studio 调试和处置对象

c# - 您可以在没有 Range 对象的情况下在 C# Interop.Excel 中运行 .Formula 吗?

tfs - 如何使用保存的发布配置文件获取 TFS 构建以预编译 Web 应用程序?

.net - 除非在代码中引用,否则通过添加引用添加的程序集不会复制到输出目录