This one has had me stumped for over a year and seems really odd and really obscure. When I build my solution, it complains about a missing referenced DLL. When I rebuild it, the problem goes away. Whenever I do a clean this returns, i.e. have to attempt a build twice before it succeeds.
This is vague, but if warranted I can give a better explanation of solution structure. Since the workaround is simply to build twice, I've never bothered to give it more attention, buts its extremely annoying.
Also, the build fails because it seems the DLL is just absent, so code that references it after fails because of missing types from the DLL. The next time I initiate the build, it works fine.
Update:
- The referenced DLL is external (ValidationFramework from CodePlex), located in the source tree.
- None of my projects are copying the DLL, just some of them reference it.
- This happens in both Debug and Release builds.
Just found it relevant to also add that project A references the ValidationFramework.dll, as does project B, but project B references project A. Now when the build error occurs, its always when the compiler goes to project B, i.e. project A always builds successfully on both first and second build attempts.
Also, when project B fails, I can click "Build" over and over to no effect, it does require a "Rebuild", so whatever "fixes" the problem that is occurring happens prior to building project B (as the problem itself might as well).