Microsoft.AspNetCore.Http.Features has been split into the following two assemblies:
For discussion, see GitHub issue dotnet/aspnetcore#32307.
ASP.NET Core 6.0
Microsoft.AspNetCore.Http.Features 5.0 shipped both in the ASP.NET shared framework and as a NuGet package. Microsoft.AspNetCore.Http.Features 5.0 targeted .NET 4.6.1, .NET Standard 2.0, and .NET 5.
Microsoft.AspNetCore.Http.Features 6.0 ships only in the ASP.NET shared framework, not as a NuGet package. It targets .NET 6 only.
Microsoft.Extensions.Features 6.0 ships in both the ASP.NET shared framework and as a NuGet package. It targets .NET 4.6.1, .NET Standard 2.0, and .NET 6.
The following types have been moved to the new Microsoft.Extensions.Features assembly:
These types are still in the
Microsoft.AspNetCore.Http.Features namespace, and type forwards have been added for compatibility.
Reason for change
This change was introduced for two reasons:
- Allows the core types to be shared more broadly across components.
- Allows the remaining Http-specific components in Microsoft.AspNetCore.Http.Features to take advantage of new runtime and language features.
When upgrading to ASP.NET Core 6.0, remove any packages references for Microsoft.AspNetCore.Http.Features. Add a package reference for Microsoft.Extensions.Features only if required.
For class libraries that need to consume the types from Microsoft.AspNetCore.Http.Features, add a
<ItemGroup> <FrameworkReference Include="Microsoft.AspNetCore.App" /> </ItemGroup>
For more information about adding the framework reference, see Use the ASP.NET Core shared framework.
Libraries with out of date references may encounter a TypeLoadException or the following error:
Error CS0433 The type 'IFeatureCollection' exists in both 'Microsoft.AspNetCore.Http.Features, Version=220.127.116.11, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.Extensions.Features, Version=18.104.22.168, Culture=neutral, PublicKeyToken=adb9793829ddae60'
To resolve the error, add a
FrameworkReference to Microsoft.AspNetCore.App to any of the affected projects.
For questions, see dotnet/aspnetcore#32307.
Submit and view feedback for