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

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

    There could be 1 package that can cause all others not to be loaded. try to comment packages from .csproj one by one and find out which one is problem to narrow it down.

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

    If there is no problem with you to update all NuGet packages that may solve this issue.

    Tools menu -> NuGet Package Manager -> Manage Nuget Packages for Solution. When this menu appears, click on the Update tab and click the Update All button.

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

    Restart Machine

    I believe that my situation was that some process was not releasing certain dlls after a cache flush and then any acquisition of dlls failed due to that lock(?).

    By restarting my machine and doing donet restore resolved the issue and I could build again without the missing package error.

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

    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

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

    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>
    
    0 讨论(0)
  • 2020-12-04 21:12

    The yellow exclamation sign is usually because of missing reference 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 is proper 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.

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