eXpand icon indicating copy to clipboard operation
eXpand copied to clipboard

Xpand.ExpressApp.Security.XpandSecurityModule Exception

Open txt2203 opened this issue 4 years ago • 6 comments

𝗗𝗲𝘀𝗰𝗿𝗶𝗯𝗲 𝘁𝗵𝗲 𝗯𝘂𝗴 XAF .NET 5 : xxx.Module add eXpandAgnostic and Xpand.XAF.Core.All by Nuget. In file Modules.cs: public TestXAF1Module() { InitializeComponent(); RequiredModuleTypes.Add(typeof(Xpand.ExpressApp.Security.XpandSecurityModule)); } => then build OK and open Model.DesignedDiffs.xafml => Error in log:

Type: InvalidOperationException Message: Exception occurs while initializing the 'Xpand.ExpressApp.Security.XpandSecurityModule' module: Object reference not set to an instance of an object. Data: 0 entries Stack trace:

at Xpand.XAF.Modules.Reactive.ReactiveModuleBase.SetupModules(ApplicationModulesManager applicationModulesManager) in D:\a\1\s\src\Modules\Reactive\ReactiveModuleBase.cs:line 94 at Xpand.XAF.Modules.Reactive.ReactiveModuleBase.SetupModulesPatch(ApplicationModulesManager __instance) in D:\a\1\s\src\Modules\Reactive\ReactiveModuleBase.cs:line 53 at DevExpress.ExpressApp.ApplicationModulesManager.SetupModules_Patch1(ApplicationModulesManager this) at DevExpress.ExpressApp.ApplicationModulesManager.Load(ITypesInfo typesInfo, Boolean loadTypesInfo) at DevExpress.ExpressApp.Utils.DesignerModelFactory.CreateModulesManager(ModuleBase module, String assembliesPath, List1 additionalModules, ISecurityStrategyBase securityInstance, Action initializeTypeInfoSources) at DevExpress.ExpressApp.Utils.DesignerModelFactory.CreateModulesManager(ModuleBase module, String assembliesPath, Action initializeTypeInfoSources) at DevExpress.ExpressApp.Design.ModelEditor.ModelLoader.LoadModel(ITypeDiscoveryService typeDiscoveryService, String targetDiffFileName, IDisposable& obj, ILogger logger) at DevExpress.ExpressApp.Design.ModelEditor.ModelEditorFormController.CreateModelEditorController() at DevExpress.ExpressApp.Design.ModelEditor.ModelEditorFormController.Init() at DevExpress.ExpressApp.Design.ModelEditorServer.ServerHost.CreateNewModelEditor(String fileName, ModelEditorInfo meInfo, String projectUniqueName, Dictionary2 settings, String frameworkVersion) at DevExpress.ExpressApp.Design.ModelEditorServer.ServerHost.<>c__DisplayClass66_0.<OpenModelEditor>b__1() at DevExpress.ExpressApp.Design.ModelEditorServer.UiRunner.<>c__DisplayClass3_0.<RunOnUIThreadCore>b__0(Object _) ---------------- InnerException:

		Type:       NullReferenceException
		Message:    Object reference not set to an instance of an object.
		Data:       0 entries
		Stack trace:

at Xpand.Persistent.Base.General.ModuleBaseExtensions.GetConnectionString(ModuleBase moduleBase) in D:\a\1\s\Xpand\Xpand.Persistent\Xpand.Persistent.Base\General\XpandModuleBase.cs:line 801 at Xpand.Persistent.Base.General.XpandModuleBase.Setup(ApplicationModulesManager moduleManager) in D:\a\1\s\Xpand\Xpand.Persistent\Xpand.Persistent.Base\General\XpandModuleBase.cs:line 520 at Xpand.ExpressApp.Security.XpandSecurityModule.Setup(ApplicationModulesManager moduleManager) in D:\a\1\s\Xpand\Xpand.ExpressApp.Modules\Security\Module.cs:line 50 at Xpand.XAF.Modules.Reactive.ReactiveModuleBase.SetupModules(ApplicationModulesManager applicationModulesManager) in D:\a\1\s\src\Modules\Reactive\ReactiveModuleBase.cs:line 87 InnerException is null

Please guide if there has any mistakes.

txt2203 avatar Nov 03 '21 08:11 txt2203

RequiredModuleTypes.Add(typeof(Xpand.ExpressApp.Security.XpandSecurityModule));

this lines says to me that you want the security module only however there are platform specific modules Win or Web as well.

Xpand.XAF.Core.All

this is not a requirement if u only into the Security module.

In any case a repro sample could help

apobekiaris avatar Nov 03 '21 08:11 apobekiaris

TestXAF1.zip See attachment for detail. I only make Blazo solution, add xpand Nuget, add code to modules.cs, and met trouble here.

txt2203 avatar Nov 03 '21 09:11 txt2203

I also can not open model editor of Xpand from menu (VSIX) . Below is output messages :

WARNING: Failed to load C:\Users\TS01\Documents\Visual Studio 2019\Projects\TestXAF1\TestXAF1.Module\bin\Debug\net5.0\Microsoft.AspNetCore.DataProtection.Extensions.dll Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

WARNING: Failed to load C:\Users\TS01\Documents\Visual Studio 2019\Projects\TestXAF1\TestXAF1.Module\bin\Debug\net5.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Could not load file or assembly 'System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

WARNING: Failed to load C:\Users\TS01\Documents\Visual Studio 2019\Projects\TestXAF1\TestXAF1.Module\bin\Debug\net5.0\reactive-extensions.dll Could not load file or assembly 'System.Reactive, Version=4.1.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

MSBuild auto-detection: using msbuild version '16.11.1.47101' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin'.

Starting C:\Users\TS01\Documents\Visual Studio 2019\Projects\TestXAF1\TestXAF1.Module\bin\Debug\net5.0\Xpand.XAF.ModelEditor.WinDesktop.exe with arguments False "C:\Users\TS01\Documents\Visual Studio 2019\Projects\TestXAF1\TestXAF1.Module\bin\Debug\net5.0\TestXAF1.Module.dll" "C:\Users\TS01\Documents\Visual Studio 2019\Projects\TestXAF1\TestXAF1.Module\Model.DesignedDiffs.xafml" "C:\Users\TS01\Documents\Visual Studio 2019\Projects\TestXAF1\TestXAF1.Module"

txt2203 avatar Nov 03 '21 10:11 txt2203

the Security module does not have a Blazor part so I guess there are problems there, and do not plan to support it specifically. New releases will be standalone modules in the Reactive repository. The VSIX is also for .NETFramework for .net5.0 there is a new editor https://github.com/eXpandFramework/Reactive.XAF/tree/master/tools/Xpand.XAF.ModelEditor

apobekiaris avatar Nov 03 '21 10:11 apobekiaris

I don't think Security module has problem. The project compiled and run OK. but can not open ModelEditor of DevExpress. Using XpandModelEditor from above link now is OK but it has some mistakes: frequently can not display interface, always auto re-opening 7-8 times every time I close the XpandModelEditor form. If installing VSIX file, it always open list modules to choose, but then can not open XpandModelEditor form (it stopped at "starting....").

txt2203 avatar Nov 05 '21 06:11 txt2203

always auto re-opening 7-8 times every time I close the XpandModelEditor form

please provide detailed steps 1,2,3 etc along with a screencast

apobekiaris avatar Nov 05 '21 07:11 apobekiaris

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

.Thank you for your contribution.

expand avatar Dec 09 '23 21:12 expand