theschmitzer
theschmitzer

Reputation: 12860

What causes Visual Studio 2005 Out-Of-Order Command Line Builds?

In Visual Studio 2005, I have a solution with explicit dependencies specified via the Project Dependencies dialog.

When I build via devenv /rebuild Release for example, the projects are built in a different order than when loading up the IDE. This is an order not allowed by my specified dependencies.

In some cases, devenv crashes :(

The log shows a number before each line showing an order, which I believe is the dependency-induced order:

11>MyExeProject - 1 error(s), 0 warning(s)

However, the builds appear to be started in that order, interrupted and continue in another order - which does not work. So 8 may finish its build before 11. If 11 links in 8, there is a problem.

A similar reordering happens in the IDE, but the build order still maintains integrity.

Need to build by command line, any ideas why this is or what the cause is?

Upvotes: 2

Views: 1296

Answers (3)

theschmitzer
theschmitzer

Reputation: 12860

Ok, here is the real answer, I believe.

Multiprocessor Builds are enabled. The dependency order is still enforced in the IDE, but not via command line, at least in VS 2005.

Turning it off is through Tools/Options/Build and Run. Set maximum to 1.

Upvotes: 8

Windows programmer
Windows programmer

Reputation: 8065

If devenv didn't crash for you when building in the IDE, you've been lucky.

The following workaround is obnoxious but it worked for me, sigh. Reboot and set the BIOS to allow only a single CPU core to run.

Upvotes: -1

Brody
Brody

Reputation: 2074

Make sure that you have set your dependancies in the solution correctly. This can directly affect build order.

Upvotes: 1

Related Questions