This is a problem within Visual Studio 2005. This occurs after an update of the .NET Framework 2.0 and is due to project reference within a single solution.
For example, when you're writing a test library which will test your assembly within the same solution, you will most likely reference the project. Then, this error may occur.
To solve this error, simply reference the file binary of your project, either the DLL or the EXE within which resides the code you want to test. This is called a file reference.
Let's suppose we have two projects called:
Company.Project.ApplicationName
;
Company.Project.ApplicationName.Tests
.
When adding the reference to our Company.Project.ApplicationName
project within our Company.Project.Application.Tests
project, we can either use the Browse or the Project tab. When using the Project tab, you create a project reference. We don't want to use this if this error occurs. What we want to use is Browse, so that we can make a file reference.
Here's a link to the Microsoft Support Website that explains this issue.
You may receive a "Could not find file 'Microsoft.Windows.CommonLanguageRuntime" error message when you build a solution of a Visual Basic 2005 Windows Application project in Visual Studio 2005