Microsoft.AspNetCore.App 2.1.1 升级“被项目阻止" [英] Microsoft.AspNetCore.App 2.1.1 upgrade "Blocked by project"

查看:40
本文介绍了Microsoft.AspNetCore.App 2.1.1 升级“被项目阻止"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 .net core 2.1 项目升级到最新版本的 Nuget 包,例如 Microsoft.Extensions.DependencyInjection.Abstractions 2.1.1.

I'm trying to upgrade a .net core 2.1 project to the latest version of Nuget packages such as Microsoft.Extensions.DependencyInjection.Abstractions 2.1.1.

但是,这被包引用 Microsoft.NETCore.App 阻止,当我尝试升级元"包 Microsoft.NETCore.App 时,我看到类似于 这个问题.已通过切换到较新版本的 SDK 解决了这个问题,但是这不是这里的选项...因为没有较新版本的 SDK(还没有?).

However this is blocked by the package reference Microsoft.NETCore.App, when I try to upgrade the "meta" package Microsoft.NETCore.App I see "Blocked by project" similar to this question. That was resolved by switching to the newer version of the SDK, however that isn't an option here... because there isn't a newer version of the SDK (yet?).

我还看到了这个答案通过使用更新包参考手动编辑 .csproj 文件来升级特定包但我怀疑这是这样做的预期方法.

I've also seen this answer to upgrade specific packages by editing the .csproj file manually with an Update package reference but I doubt that's the intended method of doing this.

我应该如何处理这个问题?现在,我只是手动包含了我实际使用的包引用并删除了元包,但我无法想象这是解决此问题的预期方法.

How should I go about this? For now I've just manually included the package references I actually use and dropped the meta package but I can't imagine that's the intended way to go about this.

推荐答案

简单.之前正在为此寻找解决方案,而我所要做的就是将其添加到受影响的项目中.

Easy. Was looking for a resolution for this earlier and I all I had to do was just add this in the projects affected.

  <PropertyGroup>
    <RuntimeFrameworkVersion>2.1.1</RuntimeFrameworkVersion>
  </PropertyGroup>

此外,对于 .NET Core 3 及更高版本,

Additionally for .NET Core 3 and beyond,

   <PropertyGroup>
     <TargetFramework>netcoreapp3.1</TargetFramework>
   </PropertyGroup>

Patrick 下面 也发布了一个答案,指出某些项目需要 .NET Core App NuGet 包.在 .NET Core 3 之后,您将不再需要它.

There was also an answer posted by Patrick below pointing out that certain projects require the .NET Core App NuGet Package. You won't need that anymore after .NET Core 3.

这篇关于Microsoft.AspNetCore.App 2.1.1 升级“被项目阻止"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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