首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将目标框架从.NetStandard 2.0更改为.net 4.7.2后,无法进行nuget恢复

将目标框架从.NetStandard 2.0更改为.net 4.7.2后,无法进行nuget恢复
EN

Stack Overflow用户
提问于 2018-07-24 00:12:23
回答 3查看 3.5K关注 0票数 4

我刚刚将我们的几个项目从.net framework 4.6.2更新到.net framework 4.7.2,我得到了以下错误:

代码语言:javascript
复制
Package Microsoft.AspNetCore 2.1.2 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.AspNetCore 2.1.2 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Authentication.Cookies 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.AspNetCore.Authentication.Cookies 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Authentication.JwtBearer 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.AspNetCore.Authentication.JwtBearer 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Cors 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.AspNetCore.Cors 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Identity.EntityFrameworkCore 2.1.2 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.AspNetCore.Identity.EntityFrameworkCore 2.1.2 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Mvc 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.AspNetCore.Mvc 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.StaticFiles 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.AspNetCore.StaticFiles 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.EntityFrameworkCore.SqlServer 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.EntityFrameworkCore.SqlServer 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.EntityFrameworkCore.Tools 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.EntityFrameworkCore.Tools 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.Extensions.Configuration.UserSecrets 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.Extensions.Configuration.UserSecrets 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.Extensions.Logging.Debug 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.Extensions.Logging.Debug 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.VisualStudio.Web.BrowserLink 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.VisualStudio.Web.BrowserLink 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.EntityFrameworkCore.Relational 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.EntityFrameworkCore.Relational 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2). Package Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    One or more packages are incompatible with .NETFramework,Version=v4.7.2.
    Package Microsoft.AspNetCore 2.1.2 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.AspNetCore 2.1.2 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Authentication.Cookies 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.AspNetCore.Authentication.Cookies 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Authentication.JwtBearer 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.AspNetCore.Authentication.JwtBearer 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Cors 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.AspNetCore.Cors 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Identity.EntityFrameworkCore 2.1.2 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.AspNetCore.Identity.EntityFrameworkCore 2.1.2 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.Mvc 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.AspNetCore.Mvc 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.AspNetCore.StaticFiles 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.AspNetCore.StaticFiles 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.EntityFrameworkCore.SqlServer 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.EntityFrameworkCore.SqlServer 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.EntityFrameworkCore.Tools 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.EntityFrameworkCore.Tools 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.Extensions.Configuration.UserSecrets 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.Extensions.Configuration.UserSecrets 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.Extensions.Logging.Debug 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.Extensions.Logging.Debug 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.VisualStudio.Web.BrowserLink 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.VisualStudio.Web.BrowserLink 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.EntityFrameworkCore.Relational 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.EntityFrameworkCore.Relational 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.1.1 is not compatible with net472 (.NETFramework,Version=v4.7.2) / win7-x86. Package Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    One or more packages are incompatible with .NETFramework,Version=v4.7.2 (win7-x86).

真正让我困惑的是,.NETFramework 4.7.2与.NET标准2.0兼容,那么为什么我们会收到这个错误消息呢?这没有意义!非常感谢您的帮助。

EN

回答 3

Stack Overflow用户

发布于 2018-11-16 22:55:10

我在CI服务器上遇到了这个问题,结果是安装了一个较旧的nuget.exe副本,将其升级到最新版本解决了这个问题(v4.1到4.7)

票数 3
EN

Stack Overflow用户

发布于 2018-09-18 15:22:14

在AzureDevOps中为我工作的解决方案,称为VSTS:

1-添加dotnet还原步骤。

2-在Nuget恢复步骤的高级选项中,选择自定义版本并将"Path to Nuget.exe“设置为:$(Build.BinariesDirectory)\nuget.exe

3-在NuGet恢复任务添加内联github外壳之前,请参阅以下PowerScript链接:https://github.com/Microsoft/vsts-tasks/issues/3756#issuecomment-288185011

不要忘记将Shell脚本中的nuget版本更改为您想要的版本(对于我来说是4.3.0)。

票数 0
EN

Stack Overflow用户

发布于 2020-10-27 16:29:17

将您的NuGet安装程序更新到版本2.*。之后,NuGet.exe将自动更新到4.3版

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

https://stackoverflow.com/questions/51483168

复制
相关文章

相似问题

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