0

I'm running on ASP.Net Core Blazor. I have a requirement to utilized the current logged in User's username. I do so using IHttpContextAccessor. It works as expected while debugging, however when I deploy to azure the IHttpContextAccessor object is null. Have no idea why this occurring.

accessor:

 [Inject]
    private IHttpContextAccessor HttpContextAccessor { get; set; } = default!;
     protected override void OnInitialized()
        {
            username = HttpContextAccessor.HttpContext.User.Identity.Name.ToString();
        }
kjenn31
  • 77
  • 2
  • 9
  • Once again a question post is closed by people who have probably never answered a question in the Blazor section. The linked provided has got nothing to do with the issue this user is facing. If you are allowed to close questions, you've got to show some responsibility. – enet Jul 28 '20 at 07:15
  • Yeah, I was a bit baffled when I came to check and saw that it was closed. – kjenn31 Jul 28 '20 at 16:02

0 Answers0