ASP.Net Core 2.0 SignInAsync returns exception Value cannot be null, provider
问题 I have an ASP.Net Core 2.0 web application I am retrofitting with unit tests (using NUnit). The application works fine, and most of the tests thus far work fine. However, testing the authentication/authorization (does a user get logged in and can access [Authorize] filtered actions) is failing with... System.ArgumentNullException: Value cannot be null. Parameter name: provider ...after... await HttpContext.SignInAsync(principal); ...but it is not clear what in fact is the underlying cause.