Visual Studio 2010 .NET 4 Build Bug
I just encountered a crazy bug in Visual Studio 2010 that I need to document. I hope this helps someone as I was banging my head against the wall!
Scenario
I had a .NET 4 class library project that I was referencing from a WinForm project (the project type probably doesn't matter). Everything was building fine for days, maybe weeks. A few completely innocuous changes later and the build broke in a mysterious way. It told me that a namespace I was using (defined in the referenced project) did not exist:
"MyApplication.Biz.Core does not exist"
Intellisense also failed to show that this namespace existed, even though it does. I removed the project reference and added it back. Before I built the project again, I checked Intellisense and it showed the namespace properly. After a build, the above error came back. After triple checking my code, I can assure you that nothing was wrong.
The Fix
Changing the target framework on both my class library and WinForm project from ".NET Framework 4 Client Profile" to ".NET Framework 4" fixed everything magically. I never choose "Client Profile," it must have picked that automatically when I created a new project.
That's some crazy shit.