So I have a solution in Visual Studio 2005 Pro (C#) with a handful of projects in it. Most of them are Class Library DLLs using COM to extend an existing application (ArcGIS). But since there's a lot of things that all of these projects do the same, I have a shared library DLL included as one of the projects. (And one of the other application DLLs, shares some of it's stuff with some of the others as well.) VS is smart enough to know that all of the other projects are dependent on the shared project and builds things in the correct order. If I do a clean solution first and then build, it also does things in the correct order.
But, it doesn't handle things correctly if you modify the shared library and re-build. It appears to rebuild the shared library first since it's first in build order as it should be. But it doesn't clean the other projects first so when those build, it first tries to unregister the DLL and fails since the shared library that DLL uses doesn't exist with the version it expects. "Cannot unregister assembly <application dll>. Could not load file or assembly '<shared dll>, Version X.x.x, etc..' or one of its dependencies. The system cannot find the file specified." If I rebuild again it compiles fine. So it's not a major problem. But it gets annoying having to do a clean before each build or build 2 sometimes 3 times before it gets through these errors and actually builds.
When I make a change to the shared library, I would expect it to mark the dependent projects as also needing to be rebuilt and clean them first, rebuild the shared library, then build the dependents. It seems to just rebuild each project one at a time starting with the shared. I would probably be fine if I could tell it to always clean on any build. It would take a little longer to build but at least I wouldn't get bothered with this all the time. Anyone have any suggestions on how to deal with this? Thanks.