Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2017 15.3 Yellow Triangles on References

This morning I upgraded to VS 2017 15.3 and now am getting yellow triangles for most of my references. The project runs fine (build is good in CLI and VS and restore has been run multiple times) that I can tell (and even better on dotnetcore 2.0 actually) but these remain. Has anyone else had this happen or have a suggestion? Thanks.

Link to project.assets.json file --> https://www.dropbox.com/s/c85yuyjiu4pnget/project.assets?dl=0

Yellow triangles in Solution Explorer

Also issue of greyed out usings and red references although everything builds and runs fine.

enter image description here

Warnings Window

like image 652
dodegaard Avatar asked Aug 21 '17 21:08

dodegaard


People also ask

How do I fix broken references in Visual Studio?

To fix a broken project reference by correcting the reference path. In Solution Explorer, right-click your project node, and then select Properties. The Project Designer appears. If you're using Visual Basic, select the References page, and then click the Reference Paths button.

How do I enable references in Visual Studio?

You can also right-click the project node and select Add > Project Reference. If you see a References node in Solution Explorer, you can use the right-click context menu to choose Add Reference. Or, right-click the project node and select Add > Reference.


2 Answers

Update: VisualStudio twitter account responded to me to note that this is a bug and they are working on a fix for the future on this....

I have two responses to my post:

1) The using issue noted with things greyed out was actually a ReSharper issue. If you upgrade to VS 2017 15.3 and use R# make sure you update it as well to 2017.2.

2) The Yellow triangles issue is being looked at by the Visual Studio team but honestly I believe it to be linked to warnings in the build that those references are being coerced to either lower dependencies (ie Newtonsoft at different levels) or previews. The quickly evolving .NET 2.0 world may have exacerbated this issue. Yellow triangles have traditionally meant missing but check your warnings to see if that is related and then review the dependency chain. I will update this answer once I hear back from VS team (shout out to them and Damian Edwards + Scott Hanselman for helping me with this on Twitter).

like image 158
dodegaard Avatar answered Oct 20 '22 00:10

dodegaard


I was experiencing the yellow triangle on references issue after updating the projects in my (.NET 4.6.1) solution to the new .NET Standard .csproj format that comes with VS2017. The references I was getting warnings for were ProjectReference type (although it seemed to spill over into PackageReference for common packages in the projects in question).

I did not have any build warnings and there was nothing in the verbose build output to indicate what the cause could be.

I could follow all warnings back to a single project in my solution. I was able to solve by removing that project from my solution and then adding it back and re-adding only the necessary project references.

It seems the issue was related to unnecessary project references (or possibly circular) caused by the new transitive dependencies support. After removing the project and adding it back with only the minimum ProjectReferences and relying on transitive dependencies support to propagate the dependency, the warnings all disappeared.

This also solved an issue where the project in question was failing compilation during a command line msbuild initiated build on my CI server which only has VS2017 build tools installed (not the full IDE).

like image 22
Simon Fox Avatar answered Oct 20 '22 00:10

Simon Fox