For a project business rule, whenever an object of type ViewModelBase
is instantiated, I need to perform some validations on the user profile to define which buttons the user will have access to in View that will be loaded.
For this, I created within the constructor of this class a call to the ObterPermissoes
method, which uses as base the data stored in the user session.
The problem is that every time that I update a DLL on the server where the application is published (IIS), the value of the object of this session comes null on the users' first access, generating exception in the application
HttpContext.Current.Session["UsuarioLogado"]
The problem is that in%% of View , the same method is executed and the session loads normally. But when the user performs a query action, when passing the method index
the session is null, even if previously, to load the screen, the information has already been read the correct way.
I'm really lost as to the reason for this error ...