Principal lost in Asp.Net MVC 5 during async call #1750
-
I'm updating our Asp.Net MVC 5 app on .Net framework 4.7.2 from Csla 4.11.2 to Csla 5.3.0. We have an async action method on our controller, which basically just does an async Fetch (DataPortal.FetchAsync) and then SaveAsync. I had forgotten to re-add Csla.AspNet.Mvc5, and after awaiting the Fetch method the principal was gone. It's a custom principal/identity, but this is not .Net core so I'm assuming that should still work (we will migrate to ClaimsPrincipal/Identity once we are done with the Csla 5 update). I added Csla.AspNet.Mvc5 but now instead the principal is lost as soon as the DataPortal_Fetch method is entered (so, even earlier than it was previously). I'm not sure where to look, since it was working earlier and the fix for this was back ported to 4.10 I believe. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
It is possible that the way the The thing to check is what is the type of |
Beta Was this translation helpful? Give feedback.
It is possible that the way the
IContextManager
is initialized has changed, or that a different provider is being used. Probably not on purpose, but a possible bug.The thing to check is what is the type of
Csla.ApplicationContext.ContextManager
after you've done theAddCsla
andUseCsla
configuration calls inStartup.cs
. Once I know what type is being used we can try and troubleshoot what's happening.