Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

People also ask

How do I update Visual Studio dependencies?

By Command-line: You can download nuget.exe,and add the path where it exists to Path system environment variables. Then you could simply reference the nuget.exe directly. After that you can use command like nuget update YourSolution. sln in Package Manager Console to update the dependencies for solution.

What is a NuGet package?

Put simply, a NuGet package is a single ZIP file with the . nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number.


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


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


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.


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>

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.