This project is read-only.
1
Vote

Wrong project reference icon is shown in solution explorer (VS2008)

description

When adding a project reference (C++, Visual Basic, etc.) to another project in Solution Explorer (right-click project's reference, then click on the Add Reference... menu item), the icon being displayed is not the standard greyish component icon.
 
In fact, the icon being displayed is the project's icon (The C++ project icon for a C++ reference, for example). We fixed the problem by adding the following instructions at line 143 in the ProjectReferenceNode.cs:
 
if( prj.Properties == null )
continue;
 
Here's a sample of part of the current code with our solution from above, so that you can easily search for already existing strings:
 
//Skip this project if it is an umodeled project (unloaded)
if(string.Compare(EnvDTE.Constants.vsProjectKindUnmodeled, prj.Kind, StringComparison.OrdinalIgnoreCase) == 0)
{
continue;
}
 
// Get the full path of the current project.
EnvDTE.Property pathProperty = null;
try
{
// OUR SOLUTION BEGINS HERE
if( prj.Properties == null )
continue;
// OUR SOLUTION ENDS HERE
pathProperty = prj.Properties.Item("FullPath");
if(null == pathProperty)
{
// The full path should alway be availabe, but if this is not the
// case then we have to skip it.
continue;
}
}

comments