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.
The error I'm getting is 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.'
Intellisense is similarly complaining that The type or namespace 'Api' does not exist in the namespace 'Client'
since it can't find the DLL.
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:
- 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?
- Stymied by ASP.NET Compilation Error CS0009
- Metadata file '…\Release\project.dll' could not be found in Visual Studio
- Visual Studio 2010: Metadata file “…/Debug/Graph.dll” could not be found
- Metadata file … could not be found error when building projects
Specifically, I've tried the following solutions (and combinations of these):
- Cleaned and rebuilt my project.
- Made sure that the target framework is not a 'client profile' version of .NET
- Verifyied that the dll has been added as a project reference
- Removed and re-added the project reference
- Verified that the project is showing the DLL in the References section in Visual Studio
- Repaired .NET
- Verified the location of the DLL (it is in the local project's bin folder as given by the error)
- Tried other versions of .NET
- Closed and restarted Visual Studio
- Rebooted my machine
- Verified there are no hidden characters surrounding the 'using' statement
- Removed all code changes since the last working build
- Verified the settings in Configuration manager, including that 'Build' is checked
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.
Any ideas about what could be going on?