首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >查找引用nuget包的包

查找引用nuget包的包
EN

Stack Overflow用户
提问于 2017-11-20 14:14:29
回答 1查看 1.1K关注 0票数 0

我正在尝试将一些代码转换为.NET核心2.0,但是,由于我是,我收到了很多NU1701警告,说有些包是使用.NET461恢复的。有趣的是我没有提到这些包裹。我如何才能发现哪个N级依赖关系实际上引用了这些包?

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

示例:

代码语言:javascript
复制
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.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-11-20 15:31:01

找到了解决办法:

  1. 将nuget还原连接到日志
  2. 从日志中选择字符串project.assets.json
  3. 在每个Select-String Microsoft.AspNet.WebApi.Core上运行project.assets.json
  4. 在编辑器中打开匹配的。看看什么依赖于Microsoft.Aspnet.WebApi.Core (例如)

在我的例子中,它是Swashbuckle,这是一个.NET全框架版本。切换到Swachbuckle.AspNetCore,依赖关系就消失了。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47394079

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档