title: The type or namespace <blah> does not exist
body: <p>Ok, I have had this one a million times before and it's been answered 1 million +1 times before.</p>
  
  <p>And yet, once again. I have 3 projects, A, B, and C, each a DLL.  Each project is .Net 4.0 (not the client build, full 4.0).  Project C references A and B.  They are referenced as projects, and the output is set to copy locally.</p>
  
  <p>In C, I have two using statements in my .cs file:</p>
  
  <pre><code>using A;
  using B;
  </code></pre>
  
  <p>When I compile, I get the complaint that is cannot find B.  A is fine.  B depends on A.</p>
  
  <p>What the heck should I do?  I've removed and re-added, closed VS2010, re-opened it, looked at the .csproj file.  And I just cannot get it.  Again, for the millionth time.</p>
  
  <p>Someone please slap enough sense into me that I learn the source of this once and for all!</p>
  
  <p>And yes, this is probably answered somewhere in StackOverflow, but not in any of the top answers I've checked so far. The terms are just too generic to be of use, too many questions where the answer is "duh, add a reference".  I'm past that point.</p>
  
  <p>Here are the errors I get.  There are 3 kinds, but from past experience, the last one is the true one.</p>
  
  <pre><code>Error   130 'AWI.WWG.EXPMRI.MriUpload.Data.MriUpload' does not contain a definition for 'Database' and no extension method 'Database' accepting a first argument of type 'AWI.WWG.EXPMRI.MriUpload.Data.MriUpload' could be found (are you missing a using directive or an assembly reference?) 
  
  Error   114 'object' does not contain a definition for &lt;blah&gt;
  
  Error   59  The type or namespace name '&lt;blah&gt;' could not be found (are you missing a using directive or an assembly reference?)    
  </code></pre>
  
  <p>Aha I looked at the warnings, not just the errors, and here is what I see:</p>
  
  <pre><code>Warning 69  The referenced project '..\..\..\..\..\..\..\Partners\integration\framework\connectors\Partners.Connectors.Base\Partners.Connectors.Base\Partners.Connectors.Base.2010.csproj' does not exist.  AWI.WWG.EXPMRI.MriUpload.Objects
  </code></pre>
  
  <p>That .csproj file is the "B" in this case.  Even though I remove and re-add the project reference I get this.  But it feels like I'm getting closer!</p>
  
  <p>Hmm, I just found another DLL, call it "D", which "A" references.  When I add it to the project, I start to get the complaint:</p>
  
  <pre><code>----------------
  The  Add Reference Dialog could not be shown due to the error:
  
  The specified path, file name, or both are too long.  The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
  ----------------
  </code></pre>
  
  <p>Could this be related, or just another distraction?</p>
  
  <hr>
  
  <p>Ok, I found the issue, though I do not understand it.</p>
  
  <p>When I add the reference through the IDE, it adds this to the csproj file of "C":</p>
  
  <pre><code>&lt;ProjectReference Include="..\..\..\..\..\..\..\Partners\integration\framework\connectors\Partners.Connectors.Base\Partners.Connectors.Base\Partners.Connectors.Base.2010.csproj"&gt;
  </code></pre>
  
  <p>This does not compile, it WARNS that it cannot find the referenced project, then all those ERRORs happen.  But then I change the ProjectReference to the following:</p>
  
  <pre><code>&lt;ProjectReference Include="C:\...\Partners.Connectors.Base.2010.csproj"&gt;
  </code></pre>
  
  <p>... and it works just fine.  Note that neither of those paths are anything close to 256 characters.  The fully qualified one is only 135 characters.  But perhaps the IDE is doing some silly decoration of the path.</p>