Clean Build Fails -- Close, Restart, Build Succeeds

We are experiencing problems getting our nightly clean builds to work. We have a C++/CLI project that includes multiple references to COM objects. All those COM objects are build as part of the larger solution. Dependencies are set properly. When a build is performed in an environment where there has not been a build before, that project fails to build. After the failure, if you look at the references in the C++/CLI project, one of the COM libraries couldn't be loaded and an Interop generated.

The dependency is set properly, and the "missing" COM library is successfully built before the failing library. Other users of this library in the solution, including a couple C# projects and traditional C++ projects, have no problem building.

Any thoughts


Answer this question

Clean Build Fails -- Close, Restart, Build Succeeds

  • runar lyngset

    It sounds like you have a dependency on one of the later projects in your solution that you are missing. Try moving the failing project so it's the last one to build.

  • Valcom

    After the first, unsuccessful build, make a copy of the whole tree.

    Reset, build the first time again (unsuccessful). Make sure it's the same as the copy. Then build again to be succesful.

    Comparing differences between the tree copy (unsuccessful) and the current copy (succcessful) may give you a clue.

    Brian


  • Tobias Hoff

    There aren't any real differences between the two directories. The only differences are files that you expect to change each time (logs and such), and all the files that should have been built but failed.

    I've noticed that sometimes some of the other C++/CLI projects have to be unloaded/reloaded in a solution in order for the references to be hooked up correctly to build. But, this one is constant. At this point I'd just be happy to find a workaround.

  • Clean Build Fails -- Close, Restart, Build Succeeds