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

查看:457
本文介绍了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.

我应该怎么做?现在,我只是手动添加了我实际使用的程序包引用,并删除了meta程序包,但我无法想象这是实现此目的的预期方法。

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.

推荐答案

简单。

  <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天全站免登陆