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

HarmonyLib.PatchProcessor.Patch() #752

Closed devtka closed 2 years ago

devtka commented 4 years ago

Good Morning, with Version 20.1.602 i have following Error before Login! Security Strategie Complex, XpandRole and XpandUser If i use XpandPermissionPolicyRole, i dont get this Error. Can you assist me, what i can do!?

You can only patch implemented methods/constructors. Path the declared method virtual System.Object DevExpress.ExpressApp.Security.AuthenticationStandard::Authenticate(DevExpress.ExpressApp.IObjectSpace objectSpace) instead.

at HarmonyLib.PatchProcessor.Patch() at HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer) at Xpand.XAF.Modules.Reactive.RxApp.<>c__DisplayClass17_0.b_0(XafApplication ) at System.Reactive.Linq.ObservableImpl.Do`1.OnNext..OnNext(TSource value) in //Rx.NET/Source/src/System.Reactive/Linq/Observable/Do.cs:line 38

apobekiaris commented 4 years ago

without a sample I cannot help much

devtka commented 4 years ago

Good Morning,

ok, if you change to AuthenticationStandard, you will get this Error. See the Code below:

Comes from RXApp.cs Line 112-122

static IObservable<XafApplication> PatchAuthentication(this XafApplication application) => application.WhenSetupComplete() .Do(_ => { var harmony = new Harmony("aaa"); if (application.Security.IsInstanceOf("DevExpress.ExpressApp.Security.SecurityStrategyBase")){ var methodInfo = ( application.Security)?.GetPropertyValue("Authentication")?.GetType().GetMethod("Authenticate"); if (methodInfo != null){ harmony.Patch(methodInfo, new HarmonyMethod(GetMethodInfo(nameof(Authenticate)))); } } });

rSeeFip commented 4 years ago

Good Morning,

exactly same Error here

apobekiaris commented 4 years ago

this code is EasyTested and called from our TestApplication however it works there and all tests are green. Please try on an empty XAF solution where u install all nuget packages you use in your solution and configure init parts such as security. Post the sample for examination. Note I do not accept solutions reference directly the assemblies, only the nuget packages cause they contain logic we might miss.

Thanks for the understanding

apobekiaris commented 4 years ago

I found a related case hopefully it same as yours with a custom AuthenticationActiveDirectory, the bot will notify u once fixed

expand commented 4 years ago

The pre-release 2.201.15.3 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.

Released packages: 1. [Xpand.Extensions.Office.Cloud v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Extensions/Xpand.Extensions.Office.Cloud) 1. [Xpand.XAF.Core.All v.2.202.39.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Modules.AutoCommit v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/AutoCommit) 1. [Xpand.XAF.Modules.CloneMemberValue v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/CloneMemberValue) 1. [Xpand.XAF.Modules.GridListEditor v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/GridListEditor) 1. [Xpand.XAF.Modules.HideToolBar v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/HideToolBar) 1. [Xpand.XAF.Modules.LookupCascade v.2.202.49.4](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/LookupCascade) 1. [Xpand.XAF.Modules.MasterDetail v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/MasterDetail) 1. [Xpand.XAF.Modules.ModelMapper v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ModelMapper) 1. [Xpand.XAF.Modules.Office.Cloud.Google v.2.202.8.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google) 1. [Xpand.XAF.Modules.Office.Cloud.Google.Tasks v.2.202.5.4](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Google.Tasks) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft v.2.202.48.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar v.2.202.19.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft.Calendar) 1. [Xpand.XAF.Modules.Office.Cloud.Microsoft.Todo v.2.202.18.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Office.Cloud.Microsoft.Todo) 1. [Xpand.XAF.Modules.OneView v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/OneView) 1. [Xpand.XAF.Modules.PositionInListView v.2.202.18.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/PositionInListView) 1. [Xpand.XAF.Modules.ProgressBarViewItem v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ProgressBarViewItem) 1. [Xpand.XAF.Modules.Reactive v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive) 1. [Xpand.XAF.Modules.Reactive.Logger v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger) 1. [Xpand.XAF.Modules.Reactive.Logger.Client.Win v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Client.Win) 1. [Xpand.XAF.Modules.Reactive.Logger.Hub v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Logger.Hub) 1. [Xpand.XAF.Modules.Reactive.Win v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Reactive.Win) 1. [Xpand.XAF.Modules.RefreshView v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/RefreshView) 1. [Xpand.XAF.Modules.SequenceGenerator v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/SequenceGenerator) 1. [Xpand.XAF.Modules.SuppressConfirmation v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/SuppressConfirmation) 1. [Xpand.XAF.Modules.ViewEditMode v.2.202.47.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewEditMode) 1. [Xpand.XAF.Modules.ViewItemValue v.2.202.13.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewItemValue) 1. [Xpand.XAF.Modules.ViewWizard v.2.202.9.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/ViewWizard) 1. [Xpand.XAF.Web.All v.2.202.39.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules) 1. [Xpand.XAF.Win.All v.2.202.39.3](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules)

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.

rSeeFip commented 4 years ago

with actual lab v2.202.39.3 problem is solved for me

thanks

devtka commented 4 years ago

Thanks alot, great Work apobekiaris! I will try today and check

expand commented 2 years ago

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

.Thank you for your contribution.