1) Create new MVC app targeting 4.6.1 (not core, using MSVS 2015 Update 3)
2) In the generated class ApplicationUser.cs add an assertion:
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
HttpContext httpContext = HttpContext.Current;
Debug.Assert(httpContext != null); // assertion fails
// ...
}
3) Run program in the debugger, login, the assertion fires.
This workaround fixes the problem however I was told that HttpContext should be available across async/await as of .NET 4.5. Should I need the workaround?
Web.Config:
<httpRuntime targetFramework="4.6.1" />