We have a VB.NET Windows Forms Solution developed using the 3.5 framework.
The solution has more than 30 projects (dlls) that are referenced from one to another. We even have some projects separated into N layers too (one for the data Access, other for the business logic, and so on).
Since a time ago the solution does not work properly. When we start Visual Studio (2008), it shows hundreds of errors. The vast majority are:
"Type 'XXXX' is not defined.
And after doing some "clean" + several "build" we are able to get the binaries.
Anyone has any idea about what is the problem and how to solve it??
You have a problem with the dependencies, maybe incorrect order or circular reference. For example this can be one of the scenarios you are suffering:
You build all projects in this order A,B,C. First time you build A,B fails but C works. Second time A fails but B,C works. Third attempt A,B,C works.
In theory Visual Studio should work out the correct order... but if you have unused dependencies or circular references it fails.
You have to review and clean your dependencies. You can use nDepend (http://ndepend.com) or similar tool (Resharper, Architecture Explorer in VS2010 Ultimate, etc.) to make a dependency map and then use it to clean your dependencies. You can find a lot of good tools in this SO question.
Once you review and clean your dependencies it would build at the first attempt.