Home > Enterprise >  Since Microsoft.AspNetCore.Hosting.Server.Abstractions is not compatible with .NET 7.0 how can I hos
Since Microsoft.AspNetCore.Hosting.Server.Abstractions is not compatible with .NET 7.0 how can I hos

Time:11-02

I recently updated my projects to .NET 7.0 and found out that Microsoft.AspNetCore.Hosting.Server.Abstractions is not compatible with the newest .NET 7.0.

How can I now host my app on .NET 7.0 on HTTPS?

CodePudding user response:

It seems that you have migrated from 2.x ASP.NET Core version at some point. As mentioned in the migration guide from 2.2 to 3.0:

A large number of NuGet packages aren't produced for ASP.NET Core 3.0. Such package references should be removed from your project file.

Microsoft.AspNetCore.Hosting.Server.Abstractions being among the list of packages which were not produced anymore since 3.0. They should be part of the shared framework:

Features of ASP.NET Core that were available through one of the packages listed above are available as part of the Microsoft.AspNetCore.App shared framework. The shared framework is the set of assemblies (.dll files) that are installed on the machine and includes a runtime component and a targeting pack.

And:

Projects that target the Microsoft.NET.Sdk.Web SDK implicitly reference the Microsoft.AspNetCore.App framework.

So basically you need to just set <Project Sdk= xml element to Microsoft.NET.Sdk.Web (read more) and everything should be available.

  • Related