eXpandFramework / eXpand

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

.NET 7 / DX 23.2 Model Editor failed to build #1040

Closed yunits closed 7 months ago

yunits commented 8 months ago

Hi, I recently updated to latest package and get the following error when trying to open Model Editor in Visual Studio:

at DevExpress.ExpressApp.Utils.Reflection.TypeData.CreateInstance(Object[] args) at DevExpress.ExpressApp.Utils.Reflection.TypeHelper.CreateInstance(Type type, Object[] args) at DevExpress.ExpressApp.ModuleBase.CreateModule(Type moduleType, ModelStoreBase diffsStore) at DevExpress.ExpressApp.Core.ModuleFactory.ModuleFactoryWithResourcesDiffsStore.CreateModule(Type moduleType) at DevExpress.ExpressApp.ApplicationModulesManager.AddModule(Type moduleType, Boolean loadModuleDiffs) 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.<>cDisplayClass66_0.b1() at DevExpress.ExpressApp.Design.ModelEditorServer.UiRunner.<>cDisplayClass3_0.b0(Object _) --- End of stack trace from previous location --- at DevExpress.ExpressApp.Design.ModelEditorServer.ServerHost.OpenModelEditor(String fileName, String projectUniqueName, Dictionary2 settings, String frameworkVersion) at DevExpress.ExpressApp.Design.ModelEditorServer.ServerProtocol.OpenModelEditor(String xafmlFileName, String projectUniqueName, Dictionary2 settings, String frameworkVersion) at System.RuntimeMethodHandle.InvokeMethod(Object target, Void* arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr args) at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span1 copyOfArgs, BindingFlags invokeAttr) --- End of stack trace from previous location --- at DevExpress.ExpressApp.Design.ModelEditorServer.LoggedServerProtocol1.Invoke(MethodInfo targetMethod, Object[] args) at generatedProxy_1.OpenModelEditor(String, String, Dictionary2, String) at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span1 copyOfArgs, BindingFlags invokeAttr) ----------InnerException---------- The type initializer for 'Xpand.XAF.Modules.Reactive.ReactiveModuleBase' threw an exception. ----------StackTrace---------- at Xpand.XAF.Modules.Reactive.ReactiveModuleBase..ctor() in C:\Agent_work\2\s\src\Modules\Reactive\ReactiveModuleBase.cs:line 24 at Xpand.XAF.Modules.SequenceGenerator.SequenceGeneratorModule..ctor() in C:\Agent_work\2\s\src\Modules\SequenceGenerator\Module.cs:line 21 at Create_SequenceGeneratorModule() at DevExpress.ExpressApp.Utils.Reflection.TypeData.CreateInstance(Object[] args) ----------InnerException---------- The type initializer for 'MonoMod.Utils.DMDEmitDynamicMethodGenerator' threw an exception. ----------StackTrace---------- at MonoMod.Utils.DMDEmitDynamicMethodGenerator.GenerateCore(DynamicMethodDefinition dmd, Object context) at MonoMod.Utils.DMDGenerator1.Generate(DynamicMethodDefinition dmd, Object context) at MonoMod.Utils.DynamicMethodDefinition.Generate(Object context) at MonoMod.Utils.DynamicMethodDefinition.Generate() at HarmonyLib.MethodPatcher.CreateReplacement(Dictionary2& finalInstructions) at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo) at HarmonyLib.PatchProcessor.Patch() at HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer) at Xpand.Extensions.Harmony.HarmonyExtensions.PatchWith(MethodInfo method, HarmonyMethod prefix, HarmonyMethod postFix, HarmonyMethod transpiler, HarmonyMethod finalizer) in C:\Agent_work\2\s\src\Extensions\Xpand.Extensions\Harmony\PatchWith.cs:line 15 at Xpand.Extensions.Harmony.HarmonyExtensions.PreFix(HarmonyMethod harmonyMethod, MethodInfo method) in C:\Agent_work\2\s\src\Extensions\Xpand.Extensions\Harmony\Prefix.cs:line 7 at Xpand.Extensions.XAF.Harmony.HarmonyExtensions.Patch(MethodInfo method, Action`1 patch, Boolean onlyRuntime) in C:\Agent_work\2\s\src\Extensions\Xpand.Extensions.XAF\Harmony\PreFix.cs:line 11 at Xpand.Extensions.XAF.Harmony.HarmonyExtensions.PreFix(HarmonyMethod harmonyMethod, MethodInfo method, Boolean onlyRuntime) in C:\Agent_work\2\s\src\Extensions\Xpand.Extensions.XAF\Harmony\PreFix.cs:line 15 at Xpand.XAF.Modules.Reactive.ReactiveModuleBase.Patch() in C:\Agent_work\2\s\src\Modules\Reactive\ReactiveModuleBase.cs:line 34 at Xpand.XAF.Modules.Reactive.ReactiveModuleBase..cctor() in C:\Agent_work\2\s\src\Modules\Reactive\ReactiveModuleBase.cs:line 28 ----------InnerException---------- Cannot find returnType fieeld on DynamicMethod ----------StackTrace---------- at MonoMod.Utils.DMDEmitDynamicMethodGenerator..cctor()

yunits commented 8 months ago

error is related to SequenceGenerator should I prepare a sample?

yunits commented 8 months ago

I will investigate if this error is related to the fact that I had installed .NET 8 SDK, even if my projects are referencing .NET 7

asmolarczyk commented 8 months ago

How did you fix the issue? I'm stuck with the same issue

apobekiaris commented 8 months ago

should I prepare a sample?

apologies I missed the case, yes please if i can repro I can fix

asmolarczyk commented 8 months ago

For me this also happens when trying to open the standalone DX ModelEditor. So I think it's rather hard to fix it on your side. I guess an update to a net8 compatible version of harmony is required. Unfortunately it is also not possible for me to use the Xpand Model Editor: When selecting a model from the list, an error is shown e.g. 'File c:\REPO_PATH\SharePointIntegration\bin\debug\ not found, please build the project'

yunits commented 8 months ago

I had no time to elaborate or create an example, therefore I downgraded DX to 23.1 There were too many changes in my projects.

yunits commented 8 months ago

@asmolarczyk do you use .NET 7 or 8?

asmolarczyk commented 8 months ago

My projects target net7

yunits commented 8 months ago

As I actually have no time to create a sample with this error, maybe you could do and upload here?

apobekiaris commented 8 months ago

is .net8 installed? I had issues as well until I updated VS to latest and accordignly .net8

apobekiaris commented 8 months ago

c:\REPO_PATH\SharePointIntegration\bin\debug\

where is your bin? as far as I remember it uses the plugin native approach so should detect it from your csproj

yunits commented 8 months ago

yes, in my case I updated Visual Studio and also got .NET 8 installed, even if I am not using it in my projects.

asmolarczyk commented 8 months ago

is .net8 installed? I had issues as well until I updated VS to latest and accordignly .net8

dotnet --list-sdks 3.0.103 [C:\Program Files\dotnet\sdk] 3.1.426 [C:\Program Files\dotnet\sdk] 6.0.202 [C:\Program Files\dotnet\sdk] 8.0.100 [C:\Program Files\dotnet\sdk]

yunits commented 8 months ago

7.0.404 [C:\Program Files\dotnet\sdk] 8.0.100 [C:\Program Files\dotnet\sdk]

apobekiaris commented 8 months ago

.net7 is missing should u try it and let us know? @asmolarczyk else provide a sample for reference so I can verify it on my side. Note harminy .net8 support is pending but .net7 should be supported

asmolarczyk commented 8 months ago

I will install net7 and let you know. https://github.com/pardeike/Harmony/issues/543 is closed since last week. Does this mean that net8 is now supported in the prerelease?

apobekiaris commented 8 months ago

thnks for the heads up!

I will schedule an update, we use a custom compilation though cause we had to sign the assembly so is not as easy as change the version

asmolarczyk commented 8 months ago

I now also installed net7 sdk, but problem persists. The standalone editor uses net8 and this causes the issues with harmony...

[MonoMod.Utils] Info: Version 25.0.0
[MonoMod.Utils] Trace: IsMono: False, IsCoreBcl: True
[MonoMod.Utils] Trace: Returned system version: 8.0.0
[MonoMod.Utils] Trace: FrameworkDescription: .NET 8.0.0
[MonoMod.Utils] Info: Detected runtime: CoreCLR 8.0.0
[MonoMod.Core] Info: Version 1.0.0

I tried to use net7 by modifying the DevExpress.ExpressApp.ModelEditor.v23.2.runtimeconfig.json, but then the ModelEditor doesn't even start.

apobekiaris commented 8 months ago

i still need a sample for reference where u at least have install all the xpand packages u use

asmolarczyk commented 8 months ago

Here you are: DXApplication23.zip This is a very minimilastic sample created by the project wizard. Before adding eXpand, the standalone model editor works just fine. As soon as I added the Xpand.XAF.Modules.Reactive module to my module project, an exception is thrown when starting the model editor. I also included the script I use to start the ModelEditor. Thanks for checking this out!

apobekiaris commented 8 months ago

The pre-release 4.232.1.0 in the Reactive.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.232.1
Xpand.Extensions.Blazor v.4.232.1
Xpand.Extensions.Mono.Cecil v.4.232.1
Xpand.Extensions.Office.Cloud v.4.232.1
Xpand.Extensions.Office.Cloud.Google.Blazor v.4.232.1
Xpand.Extensions.Reactive v.4.232.1
Xpand.Extensions.XAF v.4.232.1
Xpand.Extensions.XAF.Xpo v.4.232.1
Xpand.TestsLib v.4.232.1
Xpand.TestsLib.Blazor v.4.232.1
Xpand.TestsLib.Common v.4.232.1
Xpand.TestsLib.EasyTest v.4.232.1
Xpand.VersionConverter v.4.232.1
Xpand.XAF.Core.All v.4.232.1
Xpand.XAF.Modules.AutoCommit v.4.232.1
Xpand.XAF.Modules.Blazor v.4.232.1
Xpand.XAF.Modules.BulkObjectUpdate v.4.232.1
Xpand.XAF.Modules.CloneMemberValue v.4.232.1
Xpand.XAF.Modules.CloneModelView v.4.232.1
Xpand.XAF.Modules.Email v.4.232.1
Xpand.XAF.Modules.GridListEditor v.4.232.1
Xpand.XAF.Modules.HideToolBar v.4.232.1
Xpand.XAF.Modules.JobScheduler.Hangfire v.4.232.1
Xpand.XAF.Modules.JobScheduler.Notification v.4.232.1
Xpand.XAF.Modules.MasterDetail v.4.232.1
Xpand.XAF.Modules.ModelMapper v.4.232.1
Xpand.XAF.Modules.ModelViewInheritance v.4.232.1
Xpand.XAF.Modules.Office.Cloud.Google v.4.232.1
Xpand.XAF.Modules.Office.Cloud.Google.Calendar v.4.232.1
Xpand.XAF.Modules.Office.Cloud.Google.Tasks v.4.232.1
Xpand.XAF.Modules.Office.DocumentStyleManager v.4.232.1
Xpand.XAF.Modules.OneView v.4.232.1
Xpand.XAF.Modules.PositionInListView v.4.232.1
Xpand.XAF.Modules.ProgressBarViewItem v.4.232.1
Xpand.XAF.Modules.RazorView v.4.232.1
Xpand.XAF.Modules.Reactive v.4.232.1
Xpand.XAF.Modules.Reactive.Logger v.4.232.1
Xpand.XAF.Modules.Reactive.Logger.Client.Win v.4.232.1
Xpand.XAF.Modules.Reactive.Logger.Hub v.4.232.1
Xpand.XAF.Modules.Reactive.Rest v.4.232.1
Xpand.XAF.Modules.RefreshView v.4.232.1
Xpand.XAF.Modules.SequenceGenerator v.4.232.1
Xpand.XAF.Modules.Speech v.4.232.1
Xpand.XAF.Modules.SpellChecker v.4.232.1
Xpand.XAF.Modules.StoreToDisk v.4.232.1
Xpand.XAF.Modules.SuppressConfirmation v.4.232.1
Xpand.XAF.Modules.TenantManager v.4.232.1
Xpand.XAF.Modules.ViewEditMode v.4.232.1
Xpand.XAF.Modules.ViewItemValue v.4.232.1
Xpand.XAF.Modules.ViewWizard v.4.232.1
Xpand.XAF.Modules.Windows v.4.232.1
Xpand.XAF.Web.All v.4.232.1
Xpand.XAF.Win.All v.4.232.1

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.

asmolarczyk commented 8 months ago

If I understand it correctly, you commit fixes the Xpand ME, but not the DX ModelEditor, correct? How can I test it? Does a lab version of the vsix exist?

apobekiaris commented 8 months ago

is not ready yet, u can test once there is a public release not in lab. Harmony is not yet upgraded.

apobekiaris commented 8 months ago

I ll notify this ticket again with Harmony updates, for now locally at least Xpand ME can open allsupported framework 6,7,8

asmolarczyk commented 8 months ago

Just upgraded to Xpand.Patcher 3.0.24. DX ModelEditor is now working again for me. Thank you!

apobekiaris commented 7 months ago

The pre-release 4.232.1.0 in the Reactive.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.232.1
Xpand.Extensions.Blazor v.4.232.1
Xpand.Extensions.Mono.Cecil v.4.232.1
Xpand.Extensions.Office.Cloud v.4.232.1
Xpand.Extensions.Office.Cloud.Google.Blazor v.4.232.1
Xpand.Extensions.Reactive v.4.232.1
Xpand.Extensions.XAF v.4.232.1
Xpand.Extensions.XAF.Xpo v.4.232.1
Xpand.TestsLib v.4.232.1
Xpand.TestsLib.Blazor v.4.232.1
Xpand.TestsLib.Common v.4.232.1
Xpand.TestsLib.EasyTest v.4.232.1
Xpand.VersionConverter v.4.232.1
Xpand.XAF.Core.All v.4.232.1
Xpand.XAF.Modules.AutoCommit v.4.232.1
Xpand.XAF.Modules.Blazor v.4.232.1
Xpand.XAF.Modules.BulkObjectUpdate v.4.232.1
Xpand.XAF.Modules.CloneMemberValue v.4.232.1
Xpand.XAF.Modules.CloneModelView v.4.232.1
Xpand.XAF.Modules.Email v.4.232.1
Xpand.XAF.Modules.GridListEditor v.4.232.1
Xpand.XAF.Modules.HideToolBar v.4.232.1
Xpand.XAF.Modules.JobScheduler.Hangfire v.4.232.1
Xpand.XAF.Modules.JobScheduler.Notification v.4.232.1
Xpand.XAF.Modules.MasterDetail v.4.232.1
Xpand.XAF.Modules.ModelMapper v.4.232.1
Xpand.XAF.Modules.ModelViewInheritance v.4.232.1
Xpand.XAF.Modules.Office.Cloud.Google v.4.232.1
Xpand.XAF.Modules.Office.Cloud.Google.Calendar v.4.232.1
Xpand.XAF.Modules.Office.Cloud.Google.Tasks v.4.232.1
Xpand.XAF.Modules.Office.DocumentStyleManager v.4.232.1
Xpand.XAF.Modules.OneView v.4.232.1
Xpand.XAF.Modules.PositionInListView v.4.232.1
Xpand.XAF.Modules.ProgressBarViewItem v.4.232.1
Xpand.XAF.Modules.RazorView v.4.232.1
Xpand.XAF.Modules.Reactive v.4.232.1
Xpand.XAF.Modules.Reactive.Logger v.4.232.1
Xpand.XAF.Modules.Reactive.Logger.Client.Win v.4.232.1
Xpand.XAF.Modules.Reactive.Logger.Hub v.4.232.1
Xpand.XAF.Modules.Reactive.Rest v.4.232.1
Xpand.XAF.Modules.RefreshView v.4.232.1
Xpand.XAF.Modules.SequenceGenerator v.4.232.1
Xpand.XAF.Modules.Speech v.4.232.1
Xpand.XAF.Modules.SpellChecker v.4.232.1
Xpand.XAF.Modules.StoreToDisk v.4.232.1
Xpand.XAF.Modules.SuppressConfirmation v.4.232.1
Xpand.XAF.Modules.TenantManager v.4.232.1
Xpand.XAF.Modules.ViewEditMode v.4.232.1
Xpand.XAF.Modules.ViewItemValue v.4.232.1
Xpand.XAF.Modules.ViewWizard v.4.232.1
Xpand.XAF.Modules.Windows v.4.232.1
Xpand.XAF.Web.All v.4.232.1
Xpand.XAF.Win.All v.4.232.1

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.

yunits commented 7 months ago

I guess this issue has been fixed and can be closed. Thanks.