Unknown build error, 'Exception of type 'System.OutOfMemoryException' was thrown
According to what Microsoft recommends, it is not a good idea to have lots of projects within a single solution.
Check out this link http://support.microsoft.com/kb/949755 .
But the solution suggested in the article is not something that be straight away used, because of the code refactoring costs involved.
Have you tried building the solution from outside the IDE. (Something like MSBUILD). That might help.
JetBrains is aware of this issue, and they provide some fix for it, using this fix solved my problems for now:
http://www.jetbrains.net/confluence/display/ReSharper/OutOfMemoryException+Fix
Edit: However, OutOfMemory exception is occuring again, but it's not as often as it is when I dont use this JetBrains fix.