views:

32

answers:

1

This question to which I already found the answer is posted here in case of someone else encounters it. I decided to post the Q&A here so that SO has something about this error, since I don't know if it's been here before.


This occured after an update of the .NET Framework. Before the update, everything compiled just fine! After the update, I could compile nothing!

The error message is:

Error 1 - Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'.

A: 

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:

  1. Company.Project.ApplicationName;
  2. 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

Will Marcouiller