title: The type is defined in an assembly that is not referenced, how to find the cause?
body: <p>I know the error message is common and there are plenty of questions on SO about this error, but no solutions have helped me so far, so I decided to ask the question. Difference to most of similar questions is me using App_Code directory.</p>
  
  <p>Error message:</p>
  
  <pre class="lang-none prettyprint-override"><code>CS0012: The type 'Project.Rights.OperationsProvider' is defined in an
  assembly that is not referenced. You must add a reference to assembly
  'Project.Rights, version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
  </code></pre>
  
  <p>Source File:</p>
  
  <pre><code>c:\inetpub\wwwroot\Test\Website\App_Code\Company\Project\BusinessLogic\Manager.cs
  </code></pre>
  
  <p>Following suggestions <a href="https://stackoverflow.com/questions/496269/asp-net-page-says-i-need-to-reference-an-assembly-that-does-not-exist">here</a> and <a href="https://stackoverflow.com/questions/284433/strange-error-cs0012-the-type-x-is-defined-in-an-assembly-that-is-not-referen">here</a>, I have deleted all instances of Project.Rights.dll inside C:\Windows\Microsoft.NET/*.*
  According to <a href="https://stackoverflow.com/questions/1222281/app-code-classes-not-accessable-asp-net">this</a>, I checked if .cs files in question have build action set to "Compile". They do.
  I have also double checked that the .cs file containing the "Project.Rights.OperationsProvider" type is deployed to App_Code directory.</p>
  
  <p>For some reason, application is not looking for the type in the App_Code directory. Since I've deleted all instances of Project.Rights.dll (that I know of), I don't know which assembly the error message is mentioning.</p>