.net 找出引用nuget包的包

.net 找出引用nuget包的包,.net,.net-core,.net,.net Core,我正在尝试将一些代码转换为.NET CORE 2.0,但是,当我使用nuget restore时,我收到很多NU1701警告,说一些包是使用.NET461还原的。有趣的是,我没有提到这些包裹。我如何找出哪个N级依赖项实际引用了这些包 而且它也是软件包的古老版本,所以它肯定是某种第三方依赖。我永远不会引用这些版本的软件包。关于如何找到依赖性的来源,有什么建议吗 示例: NU1701: Package 'Microsoft.AspNet.WebApi.Client 4.0.20710' was re

我正在尝试将一些代码转换为.NET CORE 2.0,但是,当我使用nuget restore时,我收到很多NU1701警告,说一些包是使用.NET461还原的。有趣的是,我没有提到这些包裹。我如何找出哪个N级依赖项实际引用了这些包

而且它也是软件包的古老版本,所以它肯定是某种第三方依赖。我永远不会引用这些版本的软件包。关于如何找到依赖性的来源,有什么建议吗

示例:

NU1701: Package 'Microsoft.AspNet.WebApi.Client 4.0.20710' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Microsoft.AspNet.WebApi.Core 4.0.20710' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Microsoft.AspNet.WebApi.Client 4.0.20710' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Microsoft.AspNet.WebApi.Core 4.0.20710' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Microsoft.AspNet.WebApi.WebHost 4.0.20710' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Microsoft.AspNet.WebApi.WebHost 4.0.20710' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Microsoft.Net.Http 2.0.20710' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Microsoft.Net.Http 2.0.20710' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Microsoft.Web.Infrastructure 1.0.0' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Microsoft.Web.Infrastructure 1.0.0' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Swashbuckle.Core 5.6.0' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'Swashbuckle.Core 5.6.0' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'WebActivatorEx 2.0.0' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
NU1701: Package 'WebActivatorEx 2.0.0' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETCoreApp,Version=v2.0'. This may cause compatibility problems.
找到了一个解决方案:

  • 通过管道将nuget还原到日志
  • 从日志中选择字符串
    project.assets.json
  • 在每个
    project.assets.json
  • 在编辑器中打开匹配的。查看Microsoft.Aspnet.WebApi.Core所依赖的依赖项(例如)
  • 在我的例子中,是Swashback,它是一个.NET完整框架版本。切换到swachbuck.AspNetCore,依赖项消失。

    找到了解决方案:

  • 通过管道将nuget还原到日志
  • 从日志中选择字符串
    project.assets.json
  • 在每个
    project.assets.json
  • 在编辑器中打开匹配的。查看Microsoft.Aspnet.WebApi.Core所依赖的依赖项(例如)

  • 在我的例子中,是Swashback,它是一个.NET完整框架版本。切换到SwachBulk.AspNetCore,依赖项消失。

    我发布了一个msbuild目标,以帮助列出位于的依赖项,也许第二个可以帮助您尽管我非常确信您直接引用的是在.net core上不起作用的
    Swashback
    (asp.net core有一个不同的Swashback包)你说得对。虚张声势是细节中的魔鬼(见下面我的答案)。切换到Swashback.AspNetCore.:)我发布了一个msbuild目标,以帮助在列出依赖项,也许第二个目标会有所帮助。尽管我非常确信您直接引用的是在.net core上不起作用的
    Swashback
    (asp.net core有一个不同的Swashback包),但您是正确的。虚张声势是细节中的魔鬼(见下面我的答案)。切换到Swashback.AspNetCore.:)