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

Could not load assembly 'System.ComponentModel.Annotations, Version=4.2.0.0.. #835

Closed maltedbarley closed 2 years ago

maltedbarley commented 3 years ago

Am using Devexpress.XAF and the ImportWizard module (source). Updated to latest DevExpress 20.2.4.0 and lifted the target framework to v4.8. Updated all expand related code as well. While having no build errors VS throws an exception on Xpand.ExpressApp.Win.SystemModule.XpandSystemWindowsFormsModule telling me it can't find System.ComponentModel.Annotations Version=4.2.0.0 when running the application.

All projects are set to "auto-generate binding redirects" but there's no bindingRedirect in app.config for System.ComponentModel.Annotations.

Any ideas?

apobekiaris commented 3 years ago

is this assembly in your bin? is this runtime or design time?

maltedbarley commented 3 years ago

The dll is not in the application bin but both System.ComponentModel.Annotations and System.ComponentModel.DataAnnotations is in the GAC (v4.8). If I manually add System.ComponentModel.Annotations.dll to the application (the 4.4.1 version, which is .net 4.6 I believe) it throws another exception:

Exception occurs while initializing the 'Xpand.ExpressApp.Win.SystemModule.XpandSystemWindowsFormsModule' module: Attempt by method 'EnumsNET.EnumCache'2<TUnderlying,TUnderlyingOperations>.AsString(!0, EnumsNET.EnumFormat)' to access method 'EnumsNET.AttributeCollection.Get()' failed.

(EnumsNET is also updated and should work.) The problem occurs when I try to start the application = runtime.

apobekiaris commented 3 years ago

post a sample please, I cannot tell

maltedbarley commented 3 years ago

An application sample or a sample from the log file? Since I updated from .net 4.5 to 4.8 my first thoughts was that maybe there's some problem using 4.8 as the target framework together with eXpand fw.

apobekiaris commented 3 years ago

was it working b4? Xpand packages at least the main framework >=net461 compatibility.

maltedbarley commented 3 years ago

Hi. It was working before with no problems. I have got passed the above problem (by downgrading the target framework, etc) but now face a similar issue with HarmonyLib getting referenced in two different versions somehow. The problem is probably due to the fact that the expand-lib zip is no longer distributed and because of that I have used the nuget packages for expand. These packages seems to have messed up the applications references (for DX references as well). Note that I use the source code for ImportWizard, and not the precompiled modules. I am not fully clear on the updating path for the framework when using this setup. It worked fine when the expand-lib was available for download.

apobekiaris commented 3 years ago

what do u mean expandlib is not available ?

find-nugetpackage eXpandlib

Id        Version
--        -------
eXpandLib 20.2.403
maltedbarley commented 3 years ago

I mean the xpand-lib zip file containing all dll's.

apobekiaris commented 3 years ago

we only support nuget currently, cause dependencies are hard to manage by your self and do not see the reason why you should even attempt it. I spent the majority of my time to support the nugets avoiding them u need to spent a lot of time as well

apobekiaris commented 3 years ago

having all dll in a zip also makes no sense and cannot work, cause there are packages for net461,net472,netstandard2.0,netstandard2.1, netcore3.1,net5.0 and blazor which they all have dependecies build specific for their frameworks.

Nugets are the solution to it and widely accepted.

maltedbarley commented 3 years ago

Sure, I use nuget packages all the time in other applications, but I got some weird errors in this Devex-application. And not to mention some of the packages downloads and messes with a lot of Devexpress packages as well that I already manage through the Devex Updater tool.

maltedbarley commented 3 years ago

However, I am troubleshooting/recreating the issue with a new application in order to have a bit cleaner testing ground.

apobekiaris commented 3 years ago

I spent the majority of my time to support the nugets avoiding them u need to spent a lot of time as well

I feel your pain but cannot do much more, the projects are on Azure and their yml pipelines exist in the source and used to build. Therefore you could rebuild and modify all project in a fork of your own, at least in theory.

I never attempt to build the DX sources although I have the sources and I am very experienced to it. I try to find a way to use them as they are published. They work for thousands I can sure make them work for me, same stands true for the Xpand nugets

maltedbarley commented 3 years ago

I donยดt actually build the DX sources, only the expand ImportWizard source. I will probably find out what the problem is, just wanted to see if I could get any pointers or ideas. Otherwise it's ok to close the issue.

apobekiaris commented 3 years ago

The pre-release 2.201.26.1 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.202.49.2
Xpand.Extensions.Blazor v.4.202.49.2
Xpand.Extensions.Mono.Cecil v.4.202.49.2
Xpand.Extensions.Office.Cloud v.4.202.49.2
Xpand.Extensions.Office.Cloud.Google.Blazor v.4.202.49.2
Xpand.Extensions.Reactive v.4.202.49.2
Xpand.Extensions.XAF v.4.202.49.2
Xpand.Extensions.XAF.Xpo v.4.202.49.2
Xpand.TestsLib v.4.202.49.2
Xpand.TestsLib.Blazor v.4.202.49.2
Xpand.TestsLib.Common v.4.202.49.2
Xpand.TestsLib.Net461 v.4.202.49.2
Xpand.VersionConverter v.4.202.49.2
Xpand.XAF.Core.All v.4.202.49.2
Xpand.XAF.Modules.AutoCommit v.4.202.49.2
Xpand.XAF.Modules.Blazor v.4.202.49.2
Xpand.XAF.Modules.CloneMemberValue v.4.202.49.2
Xpand.XAF.Modules.CloneModelView v.4.202.49.2
Xpand.XAF.Modules.GridListEditor v.4.202.49.2
Xpand.XAF.Modules.HideToolBar v.4.202.49.2
Xpand.XAF.Modules.JobScheduler.Hangfire v.4.202.49.2
Xpand.XAF.Modules.LookupCascade v.4.202.49.2
Xpand.XAF.Modules.MasterDetail v.4.202.49.2
Xpand.XAF.Modules.ModelMapper v.4.202.49.2
Xpand.XAF.Modules.ModelViewInheritance v.4.202.49.2
Xpand.XAF.Modules.Office.Cloud.Google v.4.202.49.2
Xpand.XAF.Modules.Office.Cloud.Google.Calendar v.4.202.49.2
Xpand.XAF.Modules.Office.Cloud.Google.Tasks v.4.202.49.2
Xpand.XAF.Modules.Office.Cloud.Microsoft v.4.202.49.2
Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar v.4.202.49.2
Xpand.XAF.Modules.Office.Cloud.Microsoft.Todo v.4.202.49.2
Xpand.XAF.Modules.Office.DocumentStyleManager v.4.202.49.2
Xpand.XAF.Modules.OneView v.4.202.49.2
Xpand.XAF.Modules.PositionInListView v.4.202.49.2
Xpand.XAF.Modules.ProgressBarViewItem v.4.202.49.2
Xpand.XAF.Modules.Reactive v.4.202.49.2
Xpand.XAF.Modules.Reactive.Logger v.4.202.49.2
Xpand.XAF.Modules.Reactive.Logger.Client.Win v.4.202.49.2
Xpand.XAF.Modules.Reactive.Logger.Hub v.4.202.49.2
Xpand.XAF.Modules.RefreshView v.4.202.49.2
Xpand.XAF.Modules.SequenceGenerator v.4.202.49.2
Xpand.XAF.Modules.SuppressConfirmation v.4.202.49.2
Xpand.XAF.Modules.ViewEditMode v.4.202.49.2
Xpand.XAF.Modules.ViewItemValue v.4.202.49.2
Xpand.XAF.Modules.ViewWizard v.4.202.49.2
Xpand.XAF.Web.All v.4.202.49.2
Xpand.XAF.Win.All v.4.202.49.2

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.