温馨提示:本文翻译自stackoverflow.com,查看原文请点击:nuget - What do Yellow Warning Triangles mean on Dependencies in Visual Studio 2017?
nuget visual-studio-2017 .net-standard

nuget - 黄色警告三角形对Visual Studio 2017中的依赖关系意味着什么?

发布于 2020-03-27 16:06:01

我刚刚将PCL库转换为新的.Net Standard库,并且在依存关系上有一些黄色警告三角形,如下所示:

在此处输入图片说明

在转换过程中,它将所有nuget包(包括依赖项)传递给其他人,因此它可能是双重的。

如何找出黄色警告三角形代表什么?

编辑

构建日志:

To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.' NU1605: Detected package downgrade: NUnit from 3.8.1 to 2.6.4. Reference the package directly from the project to select a different version.
MyProj.UI.Tests -> MyProj.Core.Tests -> NUnit (>= 3.8.1)
MyProj.UI.Tests -> NUnit (>= 2.6.4) NU1605: Detected package downgrade: NUnit from 3.8.1 to 2.6.4. Reference the package directly from the project to select a different version. MyProj.UI.Tests.iOS -> MyProj.UI.Tests -> MyProj.Core.Tests -> NUnit (>= 3.8.1) MyProj.UI.Tests.iOS -> NUnit (>= 2.6.4) NU1605: Detected package downgrade: NUnit from 3.8.1 to 2.6.4. Reference the package directly from the project to select a different version.
MyProj.UI.Tests.Android -> MyProj.UI.Tests -> MyProj.Core.Tests -> NUnit (>= 3.8.1) MyProj.UI.Tests.Android -> NUnit (>= 2.6.4)

查看更多

查看更多

提问者
user1
被浏览
275
user1 2018-06-20 23:19

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)

黄色警告消失了。

从这里:https : //blogs.msdn.microsoft.com/dotnet/2017/08/14/announcing-net-standard-2-0/

我还发现您可以使用NoWarn属性,如下所示:

<ItemGroup>
  <PackageReference Include="Huitian.PowerCollections" Version="1.0.0" NoWarn="NU1701" />
</ItemGroup>