title: Sharepoint Compile with project containing two class libraries that referencing each other
body: <p>I have a Sharepoint visual Webpart that references two Class Libraries. The libraries work together to provide the Webpart with values. The solution builds with no errors or warnings.... </p>
  
  <pre><code>1&gt;------ Rebuild All started: Project: ClassLibrary1, Configuration: Debug Any CPU ------
  1&gt;  ClassLibrary1 -&gt; c:\Projects\TempWebPart\ClassLibrary1\bin\Debug\ClassLibrary1.dll
  2&gt;------ Rebuild All started: Project: ClassLibrary2, Configuration: Debug Any CPU ------
  2&gt;  ClassLibrary2 -&gt; c:\Projects\TempWebPart\ClassLibrary2\bin\Debug\ClassLibrary2.dll
  3&gt;------ Rebuild All started: Project: TempWebPart, Configuration: Debug Any CPU ------
  3&gt;  TempWebPart -&gt; c:\Projects\TempWebPart\TempWebPart\bin\Debug\TempWebPart.dll
  ========== Rebuild All: 3 succeeded, 0 failed, 0 skipped ==========
  </code></pre>
  
  <p>However when I press the start button to debug it throws errors and wont compile...</p>
  
  <pre><code>1&gt;------ Build started: Project: TempWebPart, Configuration: Debug Any CPU ------
  1&gt;  TempWebPart -&gt; c:\Projects\TempWebPart\TempWebPart\bin\Debug\TempWebPart.dll
  1&gt;  ClassLibrary1 -&gt; c:\Projects\TempWebPart\ClassLibrary1\bin\Debug\ClassLibrary1.dll
  1&gt;c:\Projects\TempWebPart\ClassLibrary2\Class2.cs(5,7,5,20): error CS0246: The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?)
  ========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
  ========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
  </code></pre>
  
  <p>I also get the following errors and warnings.</p>
  
  <pre><code>Error   1   The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?) c:\Projects\TempWebPart\ClassLibrary2\Class2.cs 5   7   TempWebPart
  </code></pre>
  
  <p>I have added the references to the Webpart project for the two classlibrary projects.
  I have also added the "assemblies from project output" for the two class libraries in the Advanced Menu under Package...</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Solution xmlns="http://schemas.microsoft.com/sharepoint/" SolutionId="0a8bd835-ad91-49a1-a82d-61e22081fbe6" SharePointProductVersion="14.0"&gt;
    &lt;Assemblies&gt;
      &lt;Assembly Location="ClassLibrary1.dll" DeploymentTarget="GlobalAssemblyCache" /&gt;
      &lt;Assembly Location="ClassLibrary2.dll" DeploymentTarget="GlobalAssemblyCache" /&gt;
      &lt;Assembly Location="TempWebPart.dll" DeploymentTarget="GlobalAssemblyCache"&gt;
        &lt;SafeControls&gt;
          &lt;SafeControl Assembly="TempWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ef7e45135ca6bea" Namespace="TempWebPart" TypeName="*" /&gt;
        &lt;/SafeControls&gt;
      &lt;/Assembly&gt;
    &lt;/Assemblies&gt;
    &lt;FeatureManifests&gt;
      &lt;FeatureManifest Location="TempWebPart_Feature1\Feature.xml" /&gt;
    &lt;/FeatureManifests&gt;
  &lt;/Solution&gt;
  </code></pre>
  
  <p>My libraries are simple just to test this case.. Here is the code...</p>
  
  <pre class="lang-cs prettyprint-override"><code>namespace ClassLibrary1
  {
      public class Class1
      {
          public String Hello = "Hello";
      }
  }
  </code></pre>
  
  <pre class="lang-cs prettyprint-override"><code>using ClassLibrary1;
  
  namespace ClassLibrary2
  {
      public class Class2
      {
          public String Hello = new ClassLibrary1.Class1().Hello;
      }
  }
  </code></pre>
  
  <p>The assemblies are signed. I have tried in a WindowsForms application and is working fine. I have tried vb libraries and a similar message appears. I guess I am missing a step somewhere. I am using vs2012. </p>
  
  <p>I am really stuck on things to try :( I would appreciate any help.</p>
  
  <p>Thanks</p>