eXpandFramework / eXpand

DevExpress XAF (eXpressApp) extension framework. ๐—น๐—ถ๐—ป๐—ธ๐—ฒ๐—ฑ๐—ถ๐—ป.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ, ๐˜†๐—ผ๐˜‚๐˜๐˜‚๐—ฏ๐—ฒ.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ and ๐˜๐˜„๐—ถ๐˜๐˜๐—ฒ๐—ฟ @๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ and or simply ๐—ฆ๐˜๐—ฎ๐—ฟ/๐˜„๐—ฎ๐˜๐—ฐ๐—ต this repository and get notified from ๐—š๐—ถ๐˜๐—›๐˜‚๐—ฏ
http://expand.expandframework.com
Microsoft Public License
222 stars 115 forks source link

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

Closed AndreasMock1 closed 2 years ago

AndreasMock1 commented 3 years ago

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.b0() 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.

apobekiaris commented 3 years ago

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

AndreasMock1 commented 3 years ago

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

apobekiaris commented 3 years ago

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 commented 3 years ago

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

apobekiaris commented 3 years ago

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

apobekiaris commented 3 years ago

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 commented 3 years ago

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

apobekiaris commented 3 years ago

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

expand commented 2 years ago

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

.Thank you for your contribution.