About 1,800 results
Open links in new tab
  1. Access HttpContext in ASP.NET Core | Microsoft Learn

    Apr 29, 2026 · For other framework and custom components that require access to HttpContext, the recommended approach is to …

  2. HttpContextAccessor Class (Microsoft.AspNetCore.Http)

    Provides an implementation of IHttpContextAccessor based on the current execution context.

  3. HttpContextAccessor in Asp.NET Core Web API - C# Corner

    In ASP.NET Core Web API, the HttpContextAccessor class is a component that provides access to the current HTTP request and …

  4. aspnetcore/src/Http/Http/src/HttpContextAccessor.cs at main · …

    // Use an object indirection to hold the HttpContext in the AsyncLocal, // so it can be cleared in all ExecutionContexts when its …

  5. c# - Should IHttpContextAccessor be avoided? Getting user …

    Although the HttpContextAccessor implementation depends on AsyncLocal and thus "ambient state," classes depend on the …

  6. HttPContextAccessor in ASP.NET Core - Techies Diary

    Jan 16, 2024 · Accessing HttpContext inside framework-level APIs like controllers, middlewares, Razor pages, and Razor views are …

  7. asp.net core - How to inject HttpContextAccessor directly from ...

    May 25, 2020 · The HttpContextAccessor makes use of a static AsyncLocal<T> property under the covers, which means that any …

  8. How to Access the HttpContext in a Class Library in ASP.NET Core?

    Sep 1, 2023 · In a static class, the class is not instantiated and doesn’t create a new instance so it won’t call the constructor; hence, …

  9. HttpContextAccessor in Asp.NET Core Web API - DEV Community

    May 26, 2023 · In ASP.NET Core Web API, the HttpContextAccessor class is a component that provides access to the current HTTP …

  10. .Net Core 8: Using HttpContext in ASP.Net Core - ASPSnippets

    Aug 9, 2024 · In this article I will explain with an example, how to use HttpContext in ASP.Net Core (.Net Core 8). Microsoft has …