title: VS 2010: C# Project Cannot Open DLL
body: <p>I'm having an issue building a project that references a DLL located in the project's bin folder, which up until yesterday was building and running without issue. </p>
  
  <p>The error I'm getting is <code>fatal error CS0009: Metadata file 'c:\MyProject\bin\myClient.dll' could not be opened -- 'Error importing module 'myClient.netmodule' of assembly 'c:\MyProject\bin\myClient.dll' -- The system cannot find the file specified.'</code> Intellisense is similarly complaining that <code>The type or namespace 'Api' does not exist in the namespace 'Client'</code> since it can't find the DLL.</p>
  
  <p>Let me know if you think this is a duplicate, but I've viewed several similar posts and the solutions did solve my problem. Here are some examples: </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/4512176/visual-studio-2010-are-you-missing-a-using-directive-or-an-assembly-reference">Visual Studio 2010 — are you missing a using directive or an assembly reference?</a></li>
  <li><a href="https://stackoverflow.com/questions/4512176/visual-studio-2010-are-you-missing-a-using-directive-or-an-assembly-reference">VS2010 - Getting “type or namespace name could not be found” but everything seems ok?</a></li>
  <li><a href="https://stackoverflow.com/questions/2011134/stymied-by-asp-net-compilation-error-cs0009">Stymied by ASP.NET Compilation Error CS0009</a></li>
  <li><a href="https://stackoverflow.com/questions/898559/metadata-file-release-project-dll-could-not-be-found-in-visual-studio">Metadata file '…\Release\project.dll' could not be found in Visual Studio</a></li>
  <li><a href="https://stackoverflow.com/questions/6917793/visual-studio-2010-metadata-file-debug-graph-dll-could-not-be-found">Visual Studio 2010: Metadata file “…/Debug/Graph.dll” could not be found</a></li>
  <li><a href="https://stackoverflow.com/questions/329142/metadata-file-could-not-be-found-error-when-building-projects">Metadata file … could not be found error when building projects</a></li>
  </ul>
  
  <p>Specifically, I've tried the following solutions (and combinations of these):</p>
  
  <ul>
  <li>Cleaned and rebuilt my project.</li>
  <li>Made sure that the target framework is not a 'client profile' version of .NET</li>
  <li>Verifyied that the dll has been added as a project reference</li>
  <li>Removed and re-added the project reference</li>
  <li>Verified that the project is showing the DLL in the References section in Visual Studio</li>
  <li>Repaired .NET</li>
  <li>Verified the location of the DLL (it is in the local project's bin folder as given by the error)</li>
  <li>Tried other versions of .NET</li>
  <li>Closed and restarted Visual Studio</li>
  <li>Rebooted my machine</li>
  <li>Verified there are no hidden characters surrounding the 'using' statement</li>
  <li>Removed all code changes since the last working build</li>
  <li>Verified the settings in Configuration manager, including that 'Build' is checked</li>
  </ul>
  
  <p>The project calling the DLL is a small class library that resides in a solution with one other small project (a console application). The DLL is an external DLL that I've been using successfully for several weeks in this project/solution.  The error arises regardless of whether I build the project from the solution or by itself.</p>
  
  <p>Any ideas about what could be going on? </p>