My ASP.Net Core MVC application have added Antiforgery middleware like below:
startup.cs
services.AddMvc(); services.Ad
What worked for me was using a new user account instead of NETWORK SERVICE as the error message included this:
System.UnauthorizedAccessException: Access to the path 'C:\Windows\system32\config\systemprofile' is denied.