Reputation: 1870
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!
Upvotes: 28
Views: 37843
Reputation: 17024
In my case it turns out that the dll
had a different version than the nuget package. Even though 1.1.14 was downloaded and the folder was called 1.1.14, upon inspection of the dll properties (under the details tab), I noticed that it was version 1.1.13.
Therefore, my csproj
had to reference a 1.1.14 folder, but a 1.1.13 dll. I changed the csproj
file to indicate this.
Upvotes: 0
Reputation: 5458
I had the same problem, after copying project-folders from another project as starting point for a new solution.
All project referenced that this yellow exclamation mark, even the references to framework assemblies.
What finally helped was to ensure, that the folder ".nuget" (Including Nuget.Config, NuGet.exe, NuGet.targets) was in my solution folder. Then I did "Restore Nuget Packages" in the Context menu of the solution. Now all exclamation marks has gone!
Upvotes: 1
Reputation: 35
Problem: This is what happened with me, I was mapping my TFS repository to a folder under C:\Users\myUserNameFolder\ The "myUserNameFolder" has special permissions for the fact that its a System folder, due to which the referenced dlls in the solution were getting the Yellow triangle and whenever I tried to re-reference all the dlls they were still getting the same Yellow triangle mark. Solution: I remapped my TFS repository to a normal folder on C:\ and that did the trick. Hope this helps to someone..
P.S. This happened in VS 2015.
Upvotes: 0
Reputation: 293
Check weather the project .NET framework is equal or greater than reference .Net framework
Upvotes: 13
Reputation: 93
I got the same issue with a project opened in Visual Studio 2015 recently.
The error came out when I've relocated a few times the physical location of the solutions default package repositories and deliberately changed the value of the repositoryPath in the NuGet.Config
In my case, I needed to remove an element whose path pointed to by the condition attribute is invalid that is inside the Target section of the csproj file.
<Error Condition="!Exists('..\..\..\..\..\Packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')"
Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\Packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
Also, this error is reproduced when the usual Package folder is removed or relocated elsewhere. One should then update this value along with the ItemGroups.
Upvotes: 6
Reputation: 4063
Change the target DotNet framework to be the same between the two projects and all will work fine. (Especially if you "upgrade")
Upvotes: 3
Reputation: 413
my problem was difference in target .NET framework versions set on the projects. the first was set to .NET 4.0 and the second was .NET 4.5 changing it solved my problem
Upvotes: 5
Reputation: 339
In my case, the solution mentioned above did not work. I am not sure, how my platform was changed to AnyCPU. I was using sqlite on the project. Then i just changed the platform to x86/arm for the emulator/device. It worked again like a charm. Hope, it helps someone.
Upvotes: 0
Reputation: 2753
I also got these errors. I am using Nuget libraries in my project. After taking an update of Microsoft.Bcl package, all reference errors got resolved.
Upvotes: 0
Reputation: 650
I had the same issue with yellow exclamation marks on a bounch of sourcecode files of a solution which is checked-in/maintained by the TFS. There was no regularity as for which files actually had an yellow exclamation mark and which not. By researching the cause for this problem, i could see that those files with yellow exclamation marks actually where not even retrieved from the TFS down onto my harddisc. I checked the HintPath etc. in .csproj files and everything looked fine there and also no other tip from this thread could help me solving the problem.
WHAT FINALLY HELPED ME was to do the following: In solution explorer right-click onto Project -> Get Specific Version... -> ('Version Type: Latest Version already selected') -> + enable checkbox 'Overwrite all files even if the local version matches the specified version' -> click 'Get' button
After i did that all sourcecode files could be successfully retrieved from the TFS and the yellow exclamation marks disappeared! I hope this helps somebody who is having the same problem!
Upvotes: 1
Reputation: 925
If your .dll files are present in source control then all you need to do is right click the Dependencies and packages folder from solution (which is under source Control Explorer) and get latest version of it.
You will find .dll files on your system.
Upvotes: 0
Reputation: 1320
Just to add to this. I recently had an issue where I was adding references that had the TargetFramework set to .NET 4.0 to a Visual Studio 2008 project. All you get is a yellow exclamation mark and explanation.
Once I realised I picked the wrong release binaries it seemed obvious!
Upvotes: 45
Reputation: 15794
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.
Upvotes: 26