Visual Studio 2010: Build fails with an error message “The referenced project XX does not exist.”

Article translations Article translations
Close Close
Article ID: 2516078 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

In Visual Studio 2010, when you try to build a solution with multiple projects where there exists dependency relationships among them, in specific conditions a build fails with the following error message. 

Error Message:
“C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1200, 9): warning: The referenced project 'Relative path to the referenced project from the current directory’ does not exist.”

A build fails with the error message above when the following conditions are met.

1. You have a solution with multiple projects where there exists dependency relationships among them.
2. The sum of the following two path length is exactly added up to 259 characters (= MAX_PATH – 1)

1) The path of a referencing project’s directory.
2) The relative path to a referenced project from the current directory (= a referencing project’s directory).

NOTE: MAX_PATH is the maximum path length defined by Windows API and is set to be 260 characters.

CAUSE

This issue occurs due to a bug in the Path.GetFullPath in .NET Framework library.
This is a known issue in Visual Studio 2010.

If you would like to know more about Path.GetFullPath method, please refer to the document below.

.NET Framework Class Library
Path.GetFullPath Method
<http://msdn.microsoft.com/en-us/library/system.io.path.getfullpath.aspx>

WORKAROUND

To work around this issue, you can change path length and make sure that the sum of the following two path length is NOT added up to 259 characters.

1) The path of a referencing project’s directory.
2) The relative path to a referenced project from the current directory (= a referencing project’s directory).

MORE INFORMATION

We will take this issue into consideration in the next version of Visual Studio.
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2516078 - Last Review: March 10, 2011 - Revision: 1.0
APPLIES TO
  • Microsoft Visual Studio 2010 Professional
  • Microsoft Visual Studio 2010 Premium
  • Microsoft Visual Studio 2010 Ultimate
Keywords: 
KB2516078

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com