Closed adamfoneil closed 3 years ago
By inlining these service methods into the main app, I can start to get line number diagnostic info. This led me to the specific null ref issue.
The root issue turns out to be inconsistent availability of HttpContext.User
-- it's present when running locally, but intermittently absent when published. Yes, that's every bit as maddening as it sounds. I ended up not needing the IUserAccessor
interface, and I also removed ISession
use, but I think I can bring it back.
I ended up making my own ISession
object that reads/writes Json in App_Data. I also started using AuthenticationStateProvider
instead of HttpContextAccessor
, and this seems to be better. I'm also going to remove all Session artifacts from the AspNetCore project because they just don't need to be there. It makes more sense to let applications figure out their own approach here. All I need to do is provide a delegate that apps can use to decide how they want to get TUser
.
So, when I deploy my new Blazor app to Azure, there's a null ref exception when the DapperCX service is resolved. This doesn't happen locally. I get some stack trace info that is leading me to this extension method
There are several possible fail points in here, but my thinking is that it's a problem within the
IOnboardUser
service. So, I want to inject some logging to see what it's doing. This involves changing theAddSessionUser
ext method to be able to add anILogger
to it.