title: MSBuild builds projects with project references correctly but not from solution
body: <p>When i build a A.sln which includes 2 projects B.csproj and C.csproj which has internal project references it throws reference errors in MSBuild. But when i build B.csproj and C.csproj seperately in MSBuild it don't throw errors. And also building A.sln in VS IDE also don't throw errors.I'm using .NET 2.0 framework. Please find below the scripts used to build the sln and projs.</p>
  
  <pre><code>MSBuild "&lt;path&gt;/A.sln" /p:Configuration=Release /p:StartupObject="" /p:WarningLevel=4 /p:Optimize=true /t:rebuild /l:Filelogger,Microsoft.Build.Engine;logfile=F:\A.sln.log /verbosity:normal
  
  MSBuild "&lt;path&gt;/B.csproj" /p:Configuration=Release /p:StartupObject="" /p:WarningLevel=4 /p:Optimize=true /t:rebuild /l:Filelogger,Microsoft.Build.Engine;logfile=F:\B.csproj.log /verbosity:normal 
  
  MSBuild "&lt;path&gt;/C.csproj" /p:Configuration=Release /p:StartupObject="" /p:WarningLevel=4 /p:Optimize=true /t:rebuild /l:Filelogger,Microsoft.Build.Engine;logfile=F:\C.csproj.log /verbosity:normal 
  </code></pre>
  
  <p>Edit:</p>
  
  <p>All the errors thrown are from code for missing refernces(all are project references). I get only three type of errors like given below.</p>
  
  <blockquote>
    <p>error CS0012: The type 'X' is defined
    in an assembly that is not referenced.
    You must add a reference to assembly
    'Y, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=aad4cbe5d7c27078'.</p>
    
    <p>error CS0234: The type or namespace
    name 'X' does not exist in the
    namespace 'Y' (are you missing an
    assembly reference?)</p>
    
    <p>error CS0246: The type or namespace
    name 'X' could not be found (are you
    missing a using directive or an
    assembly reference?)</p>
  </blockquote>
  
  <p>I cleared all previously built dlls from build paths before building from both IDE and MSBuild. But IDE just works fine and don't show a reference missing indicator in "Refrences" section for the project. </p>
  
  <p>No reference paths added manually in IDE. </p>
  
  <p>Another Update:</p>
  
  <p>I just noticed that when i open both the projects from the solution, references are correctly pointing in IDE. But when i open the projects seperately in IDE, the missing references i mentioned occuring in MSBuild creeps up. Very wierd.</p>
  
  <p>So to summarize,</p>
  
  <blockquote>
    <p>Buiilding .proj in MSBuild - Good</p>
    
    <p>Buiilding .proj in IDE - Error</p>
    
    <p>Buiilding .sln in MSBuild - Error</p>
    
    <p>Buiilding .sln in IDE - Good</p>
  </blockquote>
  
  <p>Looks very wierd for me. Help much much appreciated.</p>