eXpandFramework / eXpand

DevExpress XAF (eXpressApp) extension framework. 𝗹𝗶𝗻𝗸𝗲𝗱𝗶𝗻.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺, 𝘆𝗼𝘂𝘁𝘂𝗯𝗲.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺 and 𝘁𝘄𝗶𝘁𝘁𝗲𝗿 @𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 and or simply 𝗦𝘁𝗮𝗿/𝘄𝗮𝘁𝗰𝗵 this repository and get notified from 𝗚𝗶𝘁𝗛𝘂𝗯
http://expand.expandframework.com
Microsoft Public License
222 stars 115 forks source link

NullReferenceException in authenticate #817

Closed vimarx closed 2 years ago

vimarx commented 3 years ago

I have this issue in production in a web app, it is difficult to catch in a debug environment.

Objectspace is not Null , login parameters also aren't null, How can I go deeper?

this issue is not new (a couple of months at least), and it is making me crazy... Thanks.

System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto. en DevExpress.ExpressApp.Security.AuthenticationStandard.Authenticate(IObjectSpace objectSpace) en ClasesBase.AuthenticationStandardApp.Authenticate(IObjectSpace objectSpace) en DevExpress.ExpressApp.Security.SecurityStrategyBase.Logon(IObjectSpace objectSpace) en DevExpress.ExpressApp.XafApplication.Logon(PopupWindowShowActionExecuteEventArgs logonWindowArgs) en DevExpress.ExpressApp.XafApplication.showLogonAction_OnExecute(Object sender, PopupWindowShowActionExecuteEventArgs args) en DevExpress.ExpressApp.Actions.PopupWindowShowAction.RaiseExecute(ActionBaseEventArgs eventArgs) en DevExpress.ExpressApp.Actions.ActionBase.ExecuteCore(Delegate handler, ActionBaseEventArgs eventArgs) WEB System.Object Authenticate(DevExpress.ExpressApp.IObjectSpace) en DevExpress.ExpressApp.Security.AuthenticationStandard.Authenticate(IObjectSpace objectSpace) en ClasesBase.AuthenticationStandardApp.Authenticate(IObjectSpace objectSpace) en DevExpress.ExpressApp.Security.SecurityStrategyBase.Logon(IObjectSpace objectSpace) en DevExpress.ExpressApp.XafApplication.Logon(PopupWindowShowActionExecuteEventArgs logonWindowArgs) en DevExpress.ExpressApp.XafApplication.showLogonAction_OnExecute(Object sender, PopupWindowShowActionExecuteEventArgs args) en DevExpress.ExpressApp.Actions.PopupWindowShowAction.RaiseExecute(ActionBaseEventArgs eventArgs) en DevExpress.ExpressApp.Actions.ActionBase.ExecuteCore(Delegate handler, ActionBaseEventArgs eventArgs)

apobekiaris commented 3 years ago

do u use the MS Office packages?

vimarx commented 3 years ago

not direct, may be some lost reference?

apobekiaris commented 3 years ago

if not then I would try to gather more info by overriding the XafApplication CreateLogonObjectSpace which is the one that returns a null objectspace

        protected virtual IObjectSpace CreateLogonObjectSpace(Type objectType) {
            CheckCompatibility();
            IObjectSpace objectSpace = null;
            IObjectSpaceProvider objectSpaceProvider = GetObjectSpaceProvider(objectType);
            INonsecuredObjectSpaceProvider nonsecuredObjectSpaceProvider = objectSpaceProvider as INonsecuredObjectSpaceProvider;
            if(nonsecuredObjectSpaceProvider != null) {
                objectSpace = nonsecuredObjectSpaceProvider.CreateNonsecuredObjectSpace();
            }
            else {
                objectSpace = objectSpaceProvider?.CreateObjectSpace();
            }
            return objectSpace;
        }
vimarx commented 3 years ago

do u use the MS Office packages?

Xpand Office or DX office?

apobekiaris commented 3 years ago

looking again at the GetObjectSpaceProvider method we see that is a Type location failure problem which tell us that something is wrong with our boot so i would verify that by check the type.Assembly,Location and AssemblyQualiedName of the objectType

apobekiaris commented 3 years ago

i meant the Xpand MS packages

apobekiaris commented 3 years ago

so to clear my thoughs overrider the CreateLogonObjectSpace and when objectspace is null return the type.Assembly.Location, type.AssemblyQualiedName etc.

apobekiaris commented 3 years ago

and by return i really mean trace them in the log :)

vimarx commented 3 years ago

Thank @apobekiaris for your help, still monitoring logs for this problem.

expand commented 2 years ago

Closing issue for age. Feel free to reopen it at any time.

.Thank you for your contribution.