Yellow triangle in Visual Studio Package References

There are so many different reasons of getting this generic error. My particular use case is impacted by gitignore file. The project is configured to use package configuration and the lib (dll) were ignored in gitignore file.

I had a working solution on my local. I commited this solution to ADO main. I went to ADO and created a working branch from main branch. I open working branch and started getting these yellow triangles.

I decided to use MVC package as a test case. These are working solution lib files;

These are not working solution lib files (branch created from main).

You can see “System.Web.Mvc.dll” is missing in second picture.

How did I fix it?

The simplest way is to go to main branch in ADO and delete packages folder;

  1. Clone the repository locally
  2. Make the changes to the local version
  3. Commit the changes locally
  4. Push the changes back up to the GitHub repository

Goto each file and select Git and Add;

The folder will be back in the view;

Make sure to comment this line in gitignore file;

# NuGet Packages
# *.nupkg
# The packages folder can be ignored because of Package Restore
# SHAHZAD - Don't uncomment this line
# **/packages/*
# except build/, which is used as an MSBuild target.
# !**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
# *.nuget.props
# *.nuget.targets

Problem solved.