简体   繁体   English

Microsoft Visual Studio 2008正在与依赖项目并行构建依赖项目

[英]Microsoft Visual Studio 2008 is building dependent projects in parallel with what they are dependent on

I have a situation where we have six projects in a VS 2008 solution. 我遇到的情况是,VS 2008解决方案中有六个项目。 They have a dependency tree similar to the following: 它们具有类似于以下内容的依赖树:
A depends on B A取决于B
B depends on C, D, E, F B取决于C,D,E,F
C depends on F C取决于F
D, E, and F have no dependencies. D,E和F没有依赖性。

When I look at the "Build Order" tab in Project dependencies for the solution, everything looks kosher: F, E, D, C, B, A build order. 当我查看解决方案的项目依存关系中的“构建顺序”选项卡时,所有内容看起来都比较原始:F,E,D,C,B,A构建顺序。

When I execute the build from the command line (using our continuous integration tool), the build is started in the correct order; 当我从命令行(使用我们的持续集成工具)执行构建时,将以正确的顺序启动构建。 however, it is started in parallel. 但是,它是并行启动的。 That is the log shows build items from F, E, D, C intermingled. 该日志显示了来自F,E,D,C的构建项目混合在一起。 Unfortunately, C completes its build before F is complete and thus errors occur. 不幸的是,C在F完成之前就完成了其构建,因此会发生错误。 And, in fact, when fast building projects D & E complete, Visual Studio starts B and A, resulting in even more confusion as dependencies in F and C are incomplete. 而且,实际上,当快速构建项目D&E完成时,Visual Studio将启动B和A,由于F和C中的依赖关系不完整,导致更加混乱。

How do I force Visual Studio to wait for the completion of dependencies before beginning work on sub-projects? 如何强制Visual Studio在开始子项目工作之前等待依赖关系完成?

(Use of Visual Studio 2008 is forced on us for this project due to delivering the project on older CE environment.) (由于在较旧的CE环境中交付该项目,因此我们不得不为此项目强制使用Visual Studio2008。)

Looks like the dependency setting in solution level is not suggested, try to use project level dependencey? 似乎不建议在解决方案级别中设置依赖项,请尝试使用项目级别的依赖项吗? It works for the similar problem I encountered. 它适用于我遇到的类似问题。 Hope it helps. 希望能帮助到你。

https://blogs.msdn.microsoft.com/visualstudio/2010/12/21/incorrect-solution-build-ordering-when-using-msbuild-exe/ https://blogs.msdn.microsoft.com/visualstudio/2010/12/21/incorrect-solution-build-ordering-when-using-msbuild-exe/

https://connect.microsoft.com/VisualStudio/feedback/details/586875/msbuild-4-0-incorrectly-processes-project-dependencies-specified-in-solution-file https://connect.microsoft.com/VisualStudio/feedback/details/586875/msbuild-4-0-incorrectly-processes-project-dependencies-specified-in-solution-file

ps. PS。 the referenced articles only apply to VS2010 although... 引用的文章仅适用于VS2010,尽管...

If parallelism doesn't matter to you, have you tried making that explicit? 如果并行性对您而言并不重要,那么您是否尝试过将其明确化? From your description, D, E and F can run in parallel. 根据您的描述,D,E和F可以并行运行。 Can you explicitly make D depend on E and make E depend on F? 您可以明确地使D依赖于E并使E依赖于F吗?

I've used multi-project solution in MSVS 2008 and never had a build order problem, but my solution's dependencies dag terminated in 1 project. 我在MSVS 2008中使用了多项目解决方案,但从未遇到过构建订单问题,但是我的解决方案的依赖关系在1个项目中终止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM