黄色警告三角形对 Visual Studio 2017 中的依赖项意味着什么? [英] What do Yellow Warning Triangles mean on Dependencies in Visual Studio 2017?

查看:38
本文介绍了黄色警告三角形对 Visual Studio 2017 中的依赖项意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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:

在转换过程中,它带来了所有 nuget 包,包括依赖项,因此它可能是重复的.

During the conversion it brought all nuget packages across including dependencies so it could be dulicates.

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

How do I find out what the Yellow warning triangles represent?

编辑

构建日志:

要防止 NuGet 在构建期间还原包,请打开 VisualStudio Options 对话框,单击 Package Manager 节点并取消选中允许 NuGet 在构建期间下载丢失的包."NU1605:检测到包降级:NUnit 从 3.8.1 到 2.6.4.参考直接从项目中打包以选择不同的版本.
MyProj.UI.Tests -> MyProj.Core.Tests -> NUnit (>= 3.8.1)
MyProj.UI.Tests -> NUnit (>= 2.6.4) NU1605:检测到包降级:NUnit 从 3.8.1 到 2.6.4.直接引用包从项目中选择不同的版本.MyProj.UI.Tests.iOS-> MyProj.UI.Tests -> MyProj.Core.Tests -> NUnit (>= 3.8.1) MyProj.UI.Tests.iOS -> NUnit (>= 2.6.4) NU1605:检测到包降级:NUnit 从 3.8.1 到 2.6.4.直接引用包从项目中选择不同的版本.
MyProj.UI.Tests.Android -> MyProj.UI.Tests -> MyProj.Core.Tests ->NUnit (>= 3.8.1) MyProj.UI.Tests.Android -> NUnit (>= 2.6.4)

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)

推荐答案

在构建日志中我碰巧注意到了这一点:

In the build Log I happened to notice this:

C:程序Filesdotnetsdk2.0.2SdksMicrosoft.NET.SdkuildMicrosoft.NET.Sdk.DefaultItems.targets(199,5):警告:NETStandard.Library"的 PackageReference 包含在你的项目.这个包被 .NET SDK 隐式引用并且您通常不需要从您的项目中引用它.为了更多信息,请参见 https://aka.ms/sdkimplicitrefs

C:Program Filesdotnetsdk2.0.2SdksMicrosoft.NET.SdkuildMicrosoft.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

因此,我卸载了所有列为 .Net Standard 依赖项的软件包 nuget 列在此处:

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)

  • Microsoft.NETCore.Platforms (>= 1.1.0)

System.Collections (>= 4.3.0)

System.Collections (>= 4.3.0)

System.Collections.Concurrent (>= 4.3.0)

System.Collections.Concurrent (>= 4.3.0)

System.Diagnostics.Debug (>=> 4.3.0)

System.Diagnostics.Debug (>=> 4.3.0)

System.Diagnostics.Tools (>= 4.3.0)

System.Diagnostics.Tools (>= 4.3.0)

System.Diagnostics.Tracing (>= 4.3.0)

System.Diagnostics.Tracing (>= 4.3.0)

系统全球化 (>= 4.3.0)

System.Globalization (>= 4.3.0)

System.IO (>= 4.3.0)

System.IO (>= 4.3.0)

System.IO.Compression (>= 4.3.0)

System.IO.Compression (>= 4.3.0)

System.Linq (>= 4.3.0)

System.Linq (>= 4.3.0)

System.Linq.Expressions (>= 4.3.0)

System.Linq.Expressions (>= 4.3.0)

System.Net.Http (>= 4.3.2)

System.Net.Http (>= 4.3.2)

System.Net.Primitives (>= 4.3.0)

System.Net.Primitives (>= 4.3.0)

System.ObjectModel (>= 4.3.0)

System.ObjectModel (>= 4.3.0)

系统反射 (>= 4.3.0)

System.Reflection (>= 4.3.0)

System.Reflection.Extensions (>= 4.3.0)

System.Reflection.Extensions (>= 4.3.0)

System.Reflection.Primitives (>= 4.3.0)

System.Reflection.Primitives (>= 4.3.0)

System.Resources.ResourceManager (>= 4.3.0)

System.Resources.ResourceManager (>= 4.3.0)

System.Runtime (>= 4.3.0)

System.Runtime (>= 4.3.0)

System.Runtime.Extensions (>= 4.3.0)

System.Runtime.Extensions (>= 4.3.0)

System.Runtime.InteropServices (>= 4.3.0)

System.Runtime.InteropServices (>= 4.3.0)

System.Runtime.InteropServices.RuntimeInformation (>=> 4.3.0)

System.Runtime.InteropServices.RuntimeInformation (>=> 4.3.0)

System.Runtime.Numerics (>= 4.3.0)

System.Runtime.Numerics (>= 4.3.0)

System.Text.Encoding (>= 4.3.0)

System.Text.Encoding (>= 4.3.0)

System.Text.Encoding.Extensions (>= 4.3.0)

System.Text.Encoding.Extensions (>= 4.3.0)

System.Text.RegularExpressions (>= 4.3.0)

System.Text.RegularExpressions (>= 4.3.0)

System.Threading (>= 4.3.0)

System.Threading (>= 4.3.0)

System.Threading.Tasks (>= 4.3.0)

System.Threading.Tasks (>= 4.3.0)

System.Xml.ReaderWriter (>= 4.3.0)

System.Xml.ReaderWriter (>= 4.3.0)

System.Xml.XDocument (>= 4.3.0)

System.Xml.XDocument (>= 4.3.0)

黄色警告消失了.

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

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

I have also found you can use the NoWarn property like below:

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

这篇关于黄色警告三角形对 Visual Studio 2017 中的依赖项意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆