What do Yellow Warning Triangles mean on Dependencies in Visual Studio 2017?

Visual Studio-2017NugetVisual Studio-2019.Net Standard

Visual Studio-2017 Problem Overview


I have just converted my PCL library to a new .Net Standard library and I have some Yellow Warning triangles on my Dependencies shown below:

enter image description here

During the conversion it brought all nuget packages across including dependencies so it could be dulicates.

How do I find out what the Yellow warning triangles represent?

EDIT

Build Logs:

> To prevent NuGet from restoring packages during build, open the Visual > Studio Options dialog, click on the Package Manager node and uncheck > 'Allow NuGet to download missing packages during build.' NU1605: > Detected package downgrade: NUnit from 3.8.1 to 2.6.4. Reference the > package directly from the project to select a different version.
> MyProj.UI.Tests -> MyProj.Core.Tests -> NUnit (>= 3.8.1)
> MyProj.UI.Tests -> NUnit (>= 2.6.4) NU1605: Detected package > downgrade: NUnit from 3.8.1 to 2.6.4. Reference the package directly > from the project to select a different version. MyProj.UI.Tests.iOS > -> MyProj.UI.Tests -> MyProj.Core.Tests -> NUnit (>= 3.8.1) MyProj.UI.Tests.iOS -> NUnit (>= 2.6.4) NU1605: Detected package > downgrade: NUnit from 3.8.1 to 2.6.4. Reference the package directly > from the project to select a different version.
> MyProj.UI.Tests.Android -> MyProj.UI.Tests -> MyProj.Core.Tests -> > NUnit (>= 3.8.1) MyProj.UI.Tests.Android -> NUnit (>= 2.6.4)

Visual Studio-2017 Solutions


Solution 1 - Visual Studio-2017

As trite as it sounds, try rebuilding then restarting VS - and get on with your day :)

Solution 2 - Visual Studio-2017

run dotnet restore before you do any complicated manipulation, you are going to be provided with a lot more info than in the error window or solution explorer.

You can run this command in the Package Manager Console:

> Tools > NuGet Package Manager > Package Manager Console

Solution 3 - Visual Studio-2017

If you have the warning icon but no warnings and nothing appears to actually be wrong, right click the project > Unload Project > right click the project again > Reload Project. The icon appeared for a moment and then was cleared for me in Visual Studio 2019. This avoids a full Visual Studio restart.

Solution 4 - Visual Studio-2017

In the build Log I happened to notice this:

> C:\Program > Files\dotnet\sdk\2.0.2\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.DefaultItems.targets(199,5): > warning : A PackageReference for 'NETStandard.Library' was included in > your project. This package is implicitly referenced by the .NET SDK > and you do not typically need to reference it from your project. For > more information, see https://aka.ms/sdkimplicitrefs

I therefore went and uninstalled all packages that were listed as dependencies for the .Net Standard nuget listed here:

> .NETStandard 1.1

> - Microsoft.NETCore.Platforms (>= 1.1.0)

> - System.Collections (>= 4.3.0)

> - System.Collections.Concurrent (>= 4.3.0)

> - System.Diagnostics.Debug (>=> 4.3.0)

> - System.Diagnostics.Tools (>= 4.3.0)

> - System.Diagnostics.Tracing (>= 4.3.0)

> - System.Globalization (>= 4.3.0)

> - System.IO (>= 4.3.0)

> - System.IO.Compression (>= 4.3.0)

> - System.Linq (>= 4.3.0)

> - System.Linq.Expressions (>= 4.3.0)

> - System.Net.Http (>= 4.3.2)

> - System.Net.Primitives (>= 4.3.0)

> - System.ObjectModel (>= 4.3.0)

> - System.Reflection (>= 4.3.0)

> - System.Reflection.Extensions (>= 4.3.0)

> - System.Reflection.Primitives (>= 4.3.0)

> - System.Resources.ResourceManager (>= 4.3.0)

> - System.Runtime (>= 4.3.0)

> - System.Runtime.Extensions (>= 4.3.0)

> - System.Runtime.InteropServices (>= 4.3.0)

> - System.Runtime.InteropServices.RuntimeInformation (>=> 4.3.0)

> - System.Runtime.Numerics (>= 4.3.0)

> - System.Text.Encoding (>= 4.3.0)

> - System.Text.Encoding.Extensions (>= 4.3.0)

> - System.Text.RegularExpressions (>= 4.3.0)

> - System.Threading (>= 4.3.0)

> - System.Threading.Tasks (>= 4.3.0)

> - System.Xml.ReaderWriter (>= 4.3.0)

> - System.Xml.XDocument (>= 4.3.0)

And the yellow warnings disappeared.

From here: https://blogs.msdn.microsoft.com/dotnet/2017/08/14/announcing-net-standard-2-0/

I have also found you can use the NoWarn property like below:

<ItemGroup>
  <PackageReference Include="Huitian.PowerCollections" Version="1.0.0" NoWarn="NU1701" />
</ItemGroup>

Solution 5 - Visual Studio-2017

The yellow triangle means that the package physical file(s) is gone and no longer available on the Hard Drive.

This usually happens when issuing a get latest version request on source control in TFS, especially when using a new machine, and you want to get your project code from the TFS server.

It can also be caused by low quality internet connection which almost always will result in data loss, or corrupted downloaded files.

enter image description here

If the problem is missing a couple of packages, you can modify the packages.config file and remove these packages from the packages.config and re-install the missing packages via nuget packages manager.

But if the problem is missing more than a few packages, the best and fast way I use to retrieve missing packages is by:

  1. Opening a new instance of visual studio
  2. Create a new project solution with same project type like the one with missing packages (Example: ASP.Net MVC with Individual User Account)
  3. Update the packages of the new project to the latest to match the packages versions of the previous project solution
  4. Open the file explorer and navigate to packages folder in the new solution that you created
  5. Copy all contents of folder Packages by selecting all, Note do NOT copy the Packages folder itself only the contents inside the folder
  6. Paste that in your previous solution ( solution with the missing packages), in the Packages folder with overwrite existing items.
  7. Go to your packages folder in the solution explorer and expand it, then click the refresh button to see that many of missing packages are now showing without yellow triangle
  8. Lastly you will end up with a couple of missing packages, that are not included by default when you create new solution, you need to remove them from your packages.config file (the file which nuget package managers) reads to determine installed packages, and install those as new using the nuget package manager.

Note such problems related to missing files from projects are always hard to fix, and depends on developer experience, so don't expect an easy solution for this one.

On the cause of the error,Microsoft says it is a bug, but it can happen on any version of Visual Studio.

Solution 6 - Visual Studio-2017

Just for documentation purpose for new person with this issue try this and you will rememberme :D

If you go to: Tools > NuGet Administrator > Configurations. and you have "Allow nuget...." and "automatically check...." cheked.

The only thing than you have to do is click con the button "Clear All NuGet Cache(s)"

That's it, you don't have to edit manual thinks than can be dangerous, believe me, I use to need to done some of the steps than describe here a lot of time, and try more than 5 steps of the oficial microsoft documentation for that issue you could check it here: https://docs.microsoft.com/es-es/nuget/consume-packages/package-restore#restore-packages-automatically-using-visual-studio

But just cleaning the cache solve all the problems

Solution 7 - Visual Studio-2017

I just had this issue in VS2019 version 16.8.3 when renaming a .NET Core 3.1 project. Directly after renaming the project the yellow triangles appeared. Rebuild, clean, etc. nothing worked. Closing and reopening the solution solved it for me.

Solution 8 - Visual Studio-2017

Oddly enough, my .Net Core 3 project needed me to simply click "Load project dependencies" from the context of the project, then the warning icon disappeared.

Helpful screenshot:

enter image description here

Solution 9 - Visual Studio-2017

The yellow exclamation sign is usually because of missing references or unsupported dll. If you clone a repository then there are chances that many of the nugget packages will show yellow exclamation. If you have verified the project version and still, the problem exists you can try the below solution.

In the package manager console, select the project in which you are facing this problem and then type the following command.

Update-Package -Reinstall

This will force reinstall all the packages. This command will not update the version of NuGet packages, it will simply force reinstall them.

This solution worked in my case. I am using VS2019. Hope this will help others as well.

Solution 10 - Visual Studio-2017

-unload project

-load project

This worked for me.

Solution 11 - Visual Studio-2017

It will help if you

  • remove bin folder and obj folder
  • clean the project
  • Better also to remove the cached packages from C:\Users\{user}\.nuget\packages

Then restore the packages. that work for me.

dotnet restore

Solution 12 - Visual Studio-2017

If I try to uninstall Microsoft.NETCore.Platforms as stated in the marked answer I get the following error:

>Unable to uninstall 'Microsoft.NETCore.Platforms.1.1.0' because 'NETStandard.Library.2.0.3' depends on it.

I uninstalled the other packages, but I still get the NETSDK1023 error:

>A PackageReference for 'NETStandard.Library' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs

Now I edited my .csproj and deleted the following part

<PackageReference Include="NETStandard.Library" Version="2.0.3" />

as stated in https://aka.ms/sdkimplicitrefs under Recommendations:

>When targeting .NET Core or .NET Standard, never have an explicit reference to the Microsoft.NETCore.App or NETStandard.Library metapackages via a <PackageReference> item in your project file.

Now the warning is gone!

Solution 13 - Visual Studio-2017

I faced this error when I clone the project. the main reason was the Nuget packages couldn't restore and I find a solution by making nuget.org only active resource.

enter image description here

Make sure you select Nuget.org as only active resource.

Hope it helps

Solution 14 - Visual Studio-2017

I just updated Visual studio to 16.4.4 and the issue was resolved. The reference is fixed and no more yellow triangle. Thanks.

Solution 15 - Visual Studio-2017

I had the triangles on referenced projects dependencies. I had added reference of

 System.Drawing.dll

.There was also warning in error list box . Removing it solved the problem for me. You know ,according to warning in error list System.Drawing.dll has forwarded to System.Drawing.Common and you need to install it through Manage NuGet Packages . Now it works properly.

Solution 16 - Visual Studio-2017

Go to your project/solution directory and execute:

dotnet restore

Then you are done!

Solution 17 - Visual Studio-2017

I just Mapped my local folders to the tfs code branch and had these issues,

I had to look into the project Build order, clean them one by one in order and build them after cleaning.(Or you can try cleaning the whole solution and build it again)

You can look into the project build order by Select the Solution > Project (From Top) > Build Order

Solution 18 - Visual Studio-2017

I had taht issue, when changing the output directory:

<BaseOutputPath>$(SolutionDir)</BaseOutputPath>

As soon as i deleted that property, everything worked fine! (VS 2022 v17.0 btw)

Solution 19 - Visual Studio-2017

I had the same issue , after banging my head 2 days I found that this is because

Long path was not allowed

For example two class libraries in my project had name length > or = 40 So they were not loading dependency of netstandard2.0

If you have the same case , You need to first update long path limit from registry and set its value to 1

see https://www.thewindowsclub.com/how-to-enable-or-disable-win32-long-paths-in-windows-11-10

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

Solution 20 - Visual Studio-2017

None of the above worked for me. I had one project in the solution with warning triangles on the dependencies to other projects in the solution which caused lots of red errors in VS. However, it would build, run and debug just fine. I finally unloaded the project with a right click on the project name in the solution tree, and then reloaded the project and all is happy now. Thanks Visual Studio, smh. I am using VS 2019 16.7.1

Solution 21 - Visual Studio-2017

I had the triangles on referenced projects dependencies. I just removed and added the dependencies to remove the triangle.

I am posting this answer just because no other solutions presented here helped me.

Solution 22 - Visual Studio-2017

Right click on Solution and Rebuild Solution. It worked for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionUser1View Question on Stackoverflow
Solution 1 - Visual Studio-2017Tim TylerView Answer on Stackoverflow
Solution 2 - Visual Studio-2017AlexandreGView Answer on Stackoverflow
Solution 3 - Visual Studio-2017xr280xrView Answer on Stackoverflow
Solution 4 - Visual Studio-2017User1View Answer on Stackoverflow
Solution 5 - Visual Studio-2017Ashraf SadaView Answer on Stackoverflow
Solution 6 - Visual Studio-2017sgrysoftView Answer on Stackoverflow
Solution 7 - Visual Studio-2017DeMakiView Answer on Stackoverflow
Solution 8 - Visual Studio-2017Coruscate5View Answer on Stackoverflow
Solution 9 - Visual Studio-2017SunnyView Answer on Stackoverflow
Solution 10 - Visual Studio-2017DymondView Answer on Stackoverflow
Solution 11 - Visual Studio-2017Tarek El-MallahView Answer on Stackoverflow
Solution 12 - Visual Studio-2017testingView Answer on Stackoverflow
Solution 13 - Visual Studio-2017Shervin IvariView Answer on Stackoverflow
Solution 14 - Visual Studio-2017Ali KeserwanView Answer on Stackoverflow
Solution 15 - Visual Studio-2017Ali MahdianView Answer on Stackoverflow
Solution 16 - Visual Studio-2017AlirioView Answer on Stackoverflow
Solution 17 - Visual Studio-2017Raj RajputView Answer on Stackoverflow
Solution 18 - Visual Studio-2017puaaaalView Answer on Stackoverflow
Solution 19 - Visual Studio-2017TAHA SULTAN TEMURIView Answer on Stackoverflow
Solution 20 - Visual Studio-2017user2178025View Answer on Stackoverflow
Solution 21 - Visual Studio-2017manymanymoreView Answer on Stackoverflow
Solution 22 - Visual Studio-2017Burak DoğanView Answer on Stackoverflow