I need to create an IAuthorizationFilter in my application, which is targeting .NET Core 3.0.
I needed a reference to Microsoft.AspNetCore.Http.DefaultHttpContext. That lives in the Microsoft.AspNetCore.Http namespace.
When I added the NuGet for Microsoft.AspNetCore.Http, I got an error saying that assembly 'Microsoft.AspNetCore.Mvc.Abstractions' with version 3.0.0.0 conflicted with 'Microsoft.AspNetCore.Http.Abstractions' with version 2.2.0.0.
When I looked, the NuGet I installed was version 2.2.0. But the problem is that there is not one for version 3.0 on NuGet.
How can I get a reference to Microsoft.AspNetCore.Http.DefaultHttpContext using .NET Core 3.0?
Microsoft.AspNetCore.*are referenced automatically now when your target framework isnetcoreapp3.0. You will also need to make sure you are not referencingMicrosoft.AspNetCore.Appin you project file any longer. Unless you are using Razor pages, then you will need a Framework Reference toMicrosoft.AspNetCore.Appinstead of a Package Reference. See: docs.microsoft.com/en-us/aspnet/core/migration/22-to-30 - Chris Stillwell