Visual Studio solutions – set project build order automatically

Visual Studio solutions – set project build order automatically
November 16, 2005 Jens

Well, I think it’s about time to bring you the first technical post. So here we go:

When you combine multiple projects into one (big) solution and the different projects have dependencies between each other, you quickly go nuts, when setting the project build order or rather the project dependencies manually on the solution.

I know what you will suggest: “Just set the dependencies using project references.”

You’re right, but this has one major disadvantage: When using project references, you have to set these dependencies again, when combining some of the projects into another solution for example.

Yeah, I know what comes now: “You noob, no one sets an assembly reference to a project output dir!”

You’re right again, but if you copy the output of your project (assembly and documentation) into a central directory, using the post build step of a project, and set an assembly folder to this directory, you get clean assembly references and a central location for your assemblies. Of course this mostly makes sense for larger development projects.

This is one reason, why I prefer direct references to the resulting project assemblies.

So, here is what you get: SetBuildOrder is a macro, which sets the project build order automatically. It was tested under Visual Studio 2003 and 2005 using C# solutions/projects.

For the source code and installation instructions please visit the complete article.


Leave a reply

Your email address will not be published. Required fields are marked *