eXpand icon indicating copy to clipboard operation
eXpand copied to clipboard

Inheritance security rule violation while initializing Xpand.ExpressApp.Chart.Win.XpandChartWinModule

Open AndreasMock1 opened this issue 4 years ago • 8 comments

We have migrated our XAF project from DX 20.1.4 to 20.2.5 and eXpand to the according versions, when doing so we also changed dependencies from referencing assemblies directly to Nuget packages.

When we now deploy the software to client machines, it throws an error during start up:

10.02.21 09:30:43.479 ================================================================================ 10.02.21 09:30:43.574 Trace Log for myApp.Win.exe is started 10.02.21 09:30:43.574 ================================================================================ myApp.Win.exe Error: 0 : 10.02.21 09:31:01.674 ================================================================================ The error occurred:

Type:       AggregateException
Message:    Mindestens ein Fehler ist aufgetreten.
Data:       0 entries
Stack trace:

at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at DevExpress.ExpressApp.Win.WinApplication.SetupCore(String applicationName, IList`1 objectSpaceProviders, ApplicationModulesManager modulesManager, ISecurityStrategyBase security) at DevExpress.ExpressApp.XafApplication.Setup() at myApp.Win.Program.Main(String[] arguments) ---------------- InnerException:

		Type:       InvalidOperationException
		Message:    Exception occurs while initializing the 'Xpand.ExpressApp.Chart.Win.XpandChartWinModule' module: Inheritance security rules violated by type: "DevExpress.XtraCharts.ChartControl". Derived types must either match the security accessibility of the base type or be less accessible.
		Data:       0 entries
		Stack trace:

at Xpand.XAF.Modules.Reactive.ReactiveModuleBase.SetupModules(ApplicationModulesManager applicationModulesManager) at Xpand.XAF.Modules.Reactive.ReactiveModuleBase.SetupModulesPatch(ApplicationModulesManager __instance) at DevExpress.ExpressApp.ApplicationModulesManager.SetupModules_Patch1(ApplicationModulesManager this) at DevExpress.ExpressApp.ApplicationModulesManager.Load(ITypesInfo typesInfo, Boolean loadTypesInfo) at DevExpress.ExpressApp.XafApplication.SetupCore(String applicationName, IList`1 objectSpaceProviders, ApplicationModulesManager modulesManager, ISecurityStrategyBase security) at DevExpress.ExpressApp.Win.WinApplication.<>c__DisplayClass77_0.<SetupCore>b__0() at System.Threading.Tasks.Task.Execute() ---------------- InnerException:

				Type:       TypeLoadException
				Message:    Inheritance security rules violated by type "DevExpress.XtraCharts.ChartControl". Derived types must either match the security accessibility of the base type or be less accessible.
				Data:       0 entries
				Stack trace:

at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type) at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at Xpand.XAF.Modules.ModelMapper.Services.PredefinedMapService.GetListViewConfiguration(PredefinedMap predefinedMap, Assembly controlAssembly, String listEditorTypeName, String gridViewTypeName, String gridColumnTypeName) at Xpand.XAF.Modules.ModelMapper.Services.PredefinedMapService.GetModelMapperConfiguration(PredefinedMap predefinedMap) at Xpand.XAF.Modules.ModelMapper.Services.PredefinedMapService.ModelMapperConfiguration(PredefinedMap predefinedMap, Action1 configure) at Xpand.XAF.Modules.ModelMapper.Services.PredefinedMapService.Extend(ApplicationModulesManager modulesManager, PredefinedMap map, Action1 configure) at Xpand.ExpressApp.Chart.Win.XpandChartWinModule.Setup(ApplicationModulesManager moduleManager) at Xpand.XAF.Modules.Reactive.ReactiveModuleBase.SetupModules(ApplicationModulesManager applicationModulesManager) InnerException is null

What is a possible cause for this error and how can we solve it?

Thanks for your support.

AndreasMock1 avatar Feb 10 '21 09:02 AndreasMock1

can u repro it in an empty XAF solution having installed and register the XpandChartWinModule?

apobekiaris avatar Feb 10 '21 09:02 apobekiaris

Unfortunately not, application compiled from the sample project attached is starting up. Do you have any idea for what to check in the project not working?

inheritance_Security_violation_repro.zip

AndreasMock1 avatar Feb 10 '21 10:02 AndreasMock1

the exception is about a version missmtach i would start by clearning the nuget cache and the temp dirs. If does not start by that u haave to make sure that your dependecies are correct e.g. use the container packages only and remove any binding redirections from your app.config

let me know

apobekiaris avatar Feb 10 '21 10:02 apobekiaris

also I totally suggest u use the DX nugets rather than Gac refererences

apobekiaris avatar Feb 10 '21 10:02 apobekiaris

although u spoke about the client app does not start is not clear does it start in your dev machine?

apobekiaris avatar Feb 10 '21 10:02 apobekiaris

can u repro it in an empty XAF solution having installed and register the XpandChartWinModule?

add the XpandSystemWin module to it please and try again

apobekiaris avatar Feb 10 '21 10:02 apobekiaris

or even better if u still fail to repro it add all the modules u have in your main app and try again.

apobekiaris avatar Feb 10 '21 10:02 apobekiaris

we need to trace it down in a repro sample, so we can tell what to blame and act accordingly

apobekiaris avatar Feb 10 '21 10:02 apobekiaris

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

.Thank you for your contribution.

expand avatar Oct 23 '22 21:10 expand