Hi,
Every now and then, I have the following error while openeing Model.DesignedDiffs.xafml.
Dictionary already contains class info …
Possible reason: the assembly '…' has been loaded twice.
My problem is the same as with B93055, but the problem is I do not have the steps to reproduce this bug.
Nevertheless, I wanted to let you know. When I have the problem, cleaning my solution doesn't help me, I have to quit Visual Studio and restart it to be able to open the model editor.
By the way, the Module Editor functions normally. I have the feeling that at some point, a list of types loaded in an XPO Dictionary isn't cleared with as a result that this exception occurs…
Last time, I had the problem with the Platorm independent Module. This module loads 3 other modules:
SystemModule and a LocalizationModule (home-made) from within InitializeComponent and one extra from witin the Module's constructor via this.RequiredModuleTypes.Add(typeof(customModule));
Also, it loads one additional businessclass (User) from BaseImpl because some of my domain-classes depend on it.
(this one is loaded from within InitializeComponent)
So, a bugreport without steps to reproduce… doesn't feel very good, but then you know about it anyway…
Maybe you already have a solution?
Regards
Marco
We have closed this ticket because another page addresses its subject:
How to avoid the "Dictionary already contains class info" exception when opening Application, Module or Model Editor designers with projects having multiple dependent class libraries
Hi,
Thank you for informing us, Marco. We greatly appreciate your insight.
As I see from this report, you still use the 8.1.2 version of the suite. We have fixed a similar problem in the 8.1.6 and 8.2 versions. Can you please update your components to try to reproduce the issue on the latest version of XAF?
Anyway, we cannot reproduce this problem in 8.2. It's strange that you got this error, if you used the newest version. To fix this, we first need to reproduce it. So, it appears we need your additional help. Could you please provide us with a call stack coming to the window when the Model Editor fails? Or this call stack is the same as found in the B93055? If yes, we need to test your sample project. Perhaps you would provide us with it to allow us to test it ourselves. It will be great.
Thanks,
Dennis
Hi Dennis,
Sorry, the 8.1.2 was a typo, it should have been 8.2.1 as I have changed it right now.
I understand it's difficult to solve this problem without reproduction-steps. The moment, the error occurs again, I'll send you a stacktrace.
Thanks for your interest…
thanks,
Marco
Hi Marco,
Thank you for your answer. We will await further details.
Thanks,
Dennis
P.S.
BTW, a new 8.2.2 version of the suite is available. We would appreciate if you could try to reproduce this problem with this version.
Hi Dennis,
I think the problem has to do with 2 or more Business Object classes containing Module in the name.
I got the problem again and noticed it occured mentioning my ModuleUser BO in it's message.
Below the complete errormessage.
In the project mentioned in the errormessage, I have amongst others the following two BO's defined:
ModuleUser
ModuleLicense
I renamed ModuleUser to ModulleUser (double l) and after rebuilding I could immediately open the model editor.
Changing back to ModuleUser again immediatley gave the error back again. Then I tried the same with ModuleLicense (-> ModulleLicense)
the error dissappeared and came back after undoing the rename.
I can't send you my complete project, but hopefully, you can do something with this stacktrace…
Regards
Marco
One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed may require code or model changes.
Dictionary already contains class info 'Licensing.LicenseModule.Model.ModuleUser'. Possible reason: the assembly 'Licensing.LicenseModule, Version=1.0.3140.18816, Culture=neutral, PublicKeyToken=null' has been loaded twice.
at DevExpress.Xpo.Metadata.ReflectionDictionary.QueryClassInfo(Type classType)
at DevExpress.ExpressApp.DC.Xpo.XpoTypesInfoAdapter.FindTypeInfo(Type type)
at DevExpress.Persistent.Base.Core.ReflectionHelpers.XpoDescriptorFactory.CreateMemberInfoWrapper(Type objectType, String memberName)
at DevExpress.Persistent.Base.ComplexMemberDescriptor…ctor(DescriptorFactory factory, Type objectType, String memberName)
at DevExpress.Persistent.Base.Core.ReflectionHelpers.DescriptorFactory.CreateComplexMemberDescriptor(Type objectType, String memberName)
at DevExpress.Persistent.Base.ReflectionHelper.FindMemberDescriptor(Type type, String memberName)
at DevExpress.ExpressApp.InfoGenerators.ListViewNodeGenerator.ShouldExpandMembers(PropertyInfoNodeWrapper propertyNode)
at DevExpress.ExpressApp.InfoGenerators.ListViewNodeGenerator.GenerateColumns(ColumnsNodeWrapper columnsInfo, ClassInfoNodeWrapper classNode, String leadingPropertyPath)
at DevExpress.ExpressApp.InfoGenerators.ListViewNodeGenerator.Generate(ListViewInfoNodeWrapper listViewInfo, ClassInfoNodeWrapper classInfo)
at DevExpress.ExpressApp.InfoGenerators.DefaultInfoGenerator.GenerateListView(ClassInfoNodeWrapper classInfo)
at DevExpress.ExpressApp.InfoGenerators.DefaultInfoGenerator.Generate(ApplicationNodeWrapper model)
at DevExpress.ExpressApp.ApplicationModulesManager.GenerateDefaultModelForViews()
at DevExpress.ExpressApp.ApplicationModulesManager.LoadModel(ITypesInfo typesInfo)
at DevExpress.ExpressApp.ApplicationModulesManager.Load(ITypesInfo typesInfo)
at DevExpress.ExpressApp.Design.ModelEditor.ModelLoader.LoadModel(ITypeDiscoveryService typeDiscoveryService)
at DevExpress.ExpressApp.Design.ModelEditor.EditorPane.PrivateInit(String fileName, ModelLoader modelLoader)
Hi Marco,
Thank you for the stack trace and for the additional info you provided. It was helpful. For that purpose I have registered another bug on your behalf: ID B32244 (It's impossible to invoke the Model Editor after rebuilding a Visual Basic solution in Visual Studio 2008.). It causes the strange behavior you experience.
This bug is caused by the fact that multiple assemblies with the same name are loaded within the AppDomain. Such a problem will disappear once the bug is fixed.
To make certain that we are right in our assumption we need to know whether you have enabled auto incrementing of assembly versions or do you set the version statically? Please let us know.
Thanks,
Dennis
Hi Dennis,
You're quick in replying…
I've performed a search to find out what I'm using. I haven't touched the assembly-version attributes manually yet, but it appears that in my solution all the project created from XAF-templates (except for the XAF WebApplication) are using auto-incrementing (currently all decorated with [assembly: AssemblyVersion("1.0.*")]. Other (non-XAF-) projects used in my solution are set to :
[assembly: AssemblyVersion("1.0.0.0")]
So, I think the complete answer is that I'm using auto-incrementing as there is no persistent object declared in any of the other projects.
Regards,
Marco
Hi Marco,
Thank you for the info, this was helpful. We are working on the related bug I created, and I suggest you track its state.
Thank you for your patience,
Dennis