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

后端 未结 15 1182
猫巷女王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:23

    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!

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-04 21:26

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

    0 讨论(0)
提交回复
热议问题