HttpContext in .Net 8.0

2.1k Views Asked by At

I can't find the package or assembly for that class. Any idea to where I could find that?

I tried to find Microsoft.AspNetCore.Http.Abstractions for .Net 8.0 but no chance...

And I tried to find it in Microsoft documentation, but currently, it's latest version is for .Net 7.0.

1

There are 1 best solutions below

0
On

I had a same issue and had to declare HttpContext as a cascading parameter at the code section of pages.

[CascadingParameter] public HttpContext? HttpContext { get; set; }

Edit: Found a Microsoft documentation about accessing httpcontext in asp.net 8.0

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-context?view=aspnetcore-8.0