views:

71

answers:

1

I've been developing a class library for quite sometime and all of the sudden, sometime last week, I opened my project and all of my references have yellow exclamation points on them now (System.dll, System.Drawing.dll, etc..). I've tried removing the references and re-adding them to fix any broken reference paths, but they continue to show yellow exclamation points on them.

Nothing had changed since the last time I'd opened the project. The only thing that was different from the last time I'd opened the project was that this time I opened it from directly inside of .NET from another project. For example, I was working on a .NET 3.5 web project, then clicked File -> Open Recent Files -> My Other Solution. This closed my current current 3.5 web solution and opened the 2.0 class library solution and the problem appeared for the first time. I'm not sure how (or why) this would cause a problem, but I'm leaning toward the fact that Visual Studio got confused or something and now my assemblies are all invalid on this 2.0 class library project. (?)

What would cause this to happen and how can I fix it? I've looked around the web, but I only see that people have suggested to remove the references and re-add them; which I've done, to no avail.

I'm considering starting a new project and copying over all of my source files one by one, but would really like to avoid all this if possible.

Thanks in advance!

+1  A: 

Using the Solution Explorer, right mouse click and select Unload Project and then select Edit (name of your csproj file) to be able to edit the .csproj file directly in VS.

Under one of the <ItemGroup> nodes you will find subnodes tagged Reference. Ensure that the HintPath node value points to a valid path. Also double check the nodes SpecificVersion and Private for valid values.

Hopefully evaluating these values will help you resolve your problem.

code4life
Thanks for your tip. I did what you said and everything looks correct in the <ItemGroup>. I simply changed all of my relative references (ie. '..\..\..\') to absolute references (ie. 'c:\') and the exclamation points magically went away. :) Thanks again!
Luc