Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
501 views
in Technique[技术] by (71.8m points)

sdk - Microsoft.AspNetCore.App 2.1.1 upgrade "Blocked by project"

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.

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?).

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

Additionally for .NET Core 3 and beyond,

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...