Error: Unable to resolve service for type 'Microsoft.AspNetCore.Http.HttpContext Solution: There is a chance that you are trying to inject none Interface into a Class's Constructor. Remember, Dependency Injection works with Interfaces that have been registered with the Service Container in the Startup.cs Class file. When you try to inject HttpContext in the Constructor, the Error happens. For a solution to solve this problem see below: Change HttpContext httpContext to IHttpContextAccessor contextAccessor in the Constructor of your Class, the error should be resolved. Please leave a message below if this solution helped you, other users might want to see how you resolved the issue. Thank you.