eXpandFramework / eXpand

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

Update Model & Merge Model Errors and Crashing #778

Closed dsikic closed 2 years ago

dsikic commented 4 years ago

Hi Apostolis,

Thank you for spending so much time with me on Friday that was very valuable! After our efforts patching ModelMapper I am stuck with two errors when trying to update the model. On a related note, are you issuing a public patch for ModelMapper soon?

I've merged three issues into one because they're so tightly related. Happy to rip them apart if you need me to.

Multithreading Problem The original multi-threading error I fixed by adding the following on WinApplication startup, instead of Program.cs since it doesn't run when compiling the model. Obviously I need to go in and fix the underlying issue but at least it lets me move forward.

DevExpress.ExpressApp.Core.ControllersManager.UseParallelBatchControllerCreation = false;
DevExpress.ExpressApp.ApplicationModulesManager.UseParallelTypesCollector = false;

Now at least the external model editor works.

Update Model Errors

When updating the model on the entire solution, with your patched ModelMapper DLLs I still get two errors on some projects. How should I proceed?

`1.

Exception occurs while initializing the 'Xpand.ExpressApp.Win.SystemModule.XpandSystemWindowsFormsModule' module: _xtraLayoutAssembly check that ModelMapperModule is added to the RequiredModuleTypes collection Update failed

2.

------- Updating model differences: Project: Some.Module.Win\Some.Module.Win.csproj Error: Object '/b4b65dd2_fb13_441d_8d86_f84ffea6dc90/od7uzcgfh2aht5alwamziydz_4.rem' has been disconnected or does not exist at the server. Update failed`

Merge Model Crashing VS

On some models where I am able to Update and Edit (external Xpand Editor anyway) I am still unable to merge. Visual studio crashes on SetupModules in ReactiveModuleBase.

I believe OnNext call.

try { module.Setup(applicationModulesManager); if (module is ReactiveModuleBase reactiveModuleBase){ reactiveModuleBase.SetupCompletedSubject.OnNext(reactiveModuleBase); reactiveModuleBase.SetupCompletedSubject.OnCompleted(); } } catch(Exception e) { throw new InvalidOperationException($"Exception occurs while initializing the '{module.GetType().FullName}' module: {e.Message}", e); }

apobekiaris commented 4 years ago

Multithreading Problem

very valuable info to all but don't u consider it fixed? I would extend it a bit more like for design time only as there is the problem observed.

DevExpress.ExpressApp.Core.ControllersManager.UseParallelBatchControllerCreation = !DesignerOnlyCalculator.IsRunFromDesigner;

Update Model Errors

I quick google search relates this problem to either an obfuscator or the Antaris Razor engine. The latter is used from the Xpand EmailModule in case u have it installed.

Merge Model Crashing VS

this looked a side effect and not the actuall problem cannot suggest anything

dsikic commented 4 years ago

You mean this one, is Razor Engine related?

Exception occurs while initializing the 'Xpand.ExpressApp.Win.SystemModule.XpandSystemWindowsFormsModule' module: _xtraLayoutAssembly check that ModelMapperModule is added to the RequiredModuleTypes collection Update failed

For Model Merging I'm trying to replicate the VS crash but now it's not loading application from project file for some reason. This comes and goes. FindXafEntityProjectItem fails in DX Model Loader:

DevExpress.ExpressApp.Design.ModelEditor.ModelLoader

private XafApplication GetXafApplicationByDesigner(Project project) { ProjectItem applicationProjectItem = FindXafEntityProjectItem(project.ProjectItems, "Application"); if(applicationProjectItem == null) { **throw new ArgumentException("Cannot find Application item in '" + project.FileName + "' project");** } return GetComponentFromDesigner<XafApplication>(applicationProjectItem, typesInfo); }

apobekiaris commented 4 years ago

Update Model Errors

sorry this had 1,2 parts so my previous answer is on 2

_xtraLayoutAssembly check that ModelMapperModule is added to the RequiredModuleTypes collection

I would start making sure that DX xtralaout assembly is on the bin in case of XpandModelEditor and if it exists that is on the AppDomain by making a dummy call in the static ctor of you module. Finally if this assembly is on the AppDomain then your only way is to debug the PredifinedMapService of the ModelMapper assembly to understand why it fails to load it.

apobekiaris commented 4 years ago

DevExpress.ExpressApp.Design.ModelEditor.ModelLoader

no clue sorry as we did in our set you again have to remove stuff to trace the problem

apobekiaris commented 4 years ago

what is also very useful to analyze is the git history of eXpand from the last time that this operation was functional

apobekiaris commented 3 years ago

The pre-release 2.201.25.0 in the DevExpress.XAF lab branch includes commits that relate to this task:

To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).

Released packages: Xpand.Extensions v.4.202.48
Xpand.Extensions.Blazor v.4.202.48
Xpand.Extensions.Mono.Cecil v.4.202.48
Xpand.Extensions.Office.Cloud v.4.202.48
Xpand.Extensions.Office.Cloud.Google.Blazor v.4.202.48
Xpand.Extensions.Reactive v.4.202.48
Xpand.Extensions.XAF v.4.202.48
Xpand.Extensions.XAF.Xpo v.4.202.48
Xpand.TestsLib v.4.202.48
Xpand.TestsLib.Blazor v.4.202.48
Xpand.TestsLib.Common v.4.202.48
Xpand.TestsLib.Net461 v.4.202.48
Xpand.XAF.Core.All v.4.202.48
Xpand.XAF.Modules.AutoCommit v.4.202.48
Xpand.XAF.Modules.Blazor v.4.202.48
Xpand.XAF.Modules.CloneMemberValue v.4.202.48
Xpand.XAF.Modules.CloneModelView v.4.202.48
Xpand.XAF.Modules.GridListEditor v.4.202.48
Xpand.XAF.Modules.HideToolBar v.4.202.48
Xpand.XAF.Modules.JobScheduler.Hangfire v.4.202.48
Xpand.XAF.Modules.LookupCascade v.4.202.48
Xpand.XAF.Modules.MasterDetail v.4.202.48
Xpand.XAF.Modules.ModelMapper v.4.202.48
Xpand.XAF.Modules.ModelViewInheritance v.4.202.48
Xpand.XAF.Modules.Office.Cloud.Google v.4.202.48
Xpand.XAF.Modules.Office.Cloud.Google.Calendar v.4.202.48
Xpand.XAF.Modules.Office.Cloud.Google.Tasks v.4.202.48
Xpand.XAF.Modules.Office.Cloud.Microsoft v.4.202.48
Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar v.4.202.48
Xpand.XAF.Modules.Office.Cloud.Microsoft.Todo v.4.202.48
Xpand.XAF.Modules.Office.DocumentStyleManager v.4.202.48
Xpand.XAF.Modules.OneView v.4.202.48
Xpand.XAF.Modules.PositionInListView v.4.202.48
Xpand.XAF.Modules.ProgressBarViewItem v.4.202.48
Xpand.XAF.Modules.Reactive v.4.202.48
Xpand.XAF.Modules.Reactive.Logger v.4.202.48
Xpand.XAF.Modules.Reactive.Logger.Client.Win v.4.202.48
Xpand.XAF.Modules.Reactive.Logger.Hub v.4.202.48
Xpand.XAF.Modules.RefreshView v.4.202.48
Xpand.XAF.Modules.SequenceGenerator v.4.202.48
Xpand.XAF.Modules.SuppressConfirmation v.4.202.48
Xpand.XAF.Modules.ViewEditMode v.4.202.48
Xpand.XAF.Modules.ViewItemValue v.4.202.48
Xpand.XAF.Modules.ViewWizard v.4.202.48
Xpand.XAF.Web.All v.4.202.48
Xpand.XAF.Win.All v.4.202.48

Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.

If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.

Thanks a lot for your contribution.

expand commented 2 years ago

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

.Thank you for your contribution.