One of the things we discovered as we moved to TFS (which uses msbuild, at least as we have it configured) from VSS/CruiseControl.NET (which I'm guessing used devenv in our configuration) is that sometimes the ProjectGuids get out of sync.
So, Project A references Project B and the project or solution file for Project A has the ProjectGuid and path to Project B's project file. However, for whatever reason Project B's ProjectGuid has changed and Project A's project or solution file didn't get updated to reflect this.
Devenv is fine because it either just uses the file path to Project B's project file or it falls back to it. Msbuild, however, stops cold at this point because if the ProjectGuids don't match it's a no-go. At this point you can either fix it in Visual Studio (I think removing and re-adding the project works) or manually through Notepad or something.
I'll leave it up to you to decide which is better (strict adherence to the ProjectGuid or leniency when the path to the project is known)