Re: WinForms - ApplicationContext.User principal being lost

Re: WinForms - ApplicationContext.User principal being lost

Old forum URL: forums.lhotka.net/forums/t/12276.aspx


andrew123 posted on Wednesday, December 18, 2013

This turned out to be an issue with where the initial principal was being set.  The application was loading a Login Form from the Shown event of the main form.  This Login Form then set the principal upon successfully logging in.  

However, I discovered that once the Shown event had completed, it was at this point that the principal was reverting back to the Generic Principal. 

Moving everything to the Load event , rather than the Shown, fixed my issue.  

I don't know why this was (they are DevEx Forms too if it is specific to this) though!

Copyright (c) Marimer LLC