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

后端 未结 15 1217
猫巷女王i
猫巷女王i 2020-12-04 20:24

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:

During the conv

15条回答
  •  粉色の甜心
    2020-12-04 21:24

    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.

    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.

提交回复
热议问题