A problem of opening the designer of the Model.xafml file in Visual Studio 2010.

In some versions of the Dev Express XAF Framework exists a problem of the visual studio 2010 designer which should open *.xafml files. If you open such files you will be able to see the following error:

"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. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. "

at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at DevExpress.ExpressApp.ModuleBase.get_DeclaredBusinessClasses()
at DevExpress.ExpressApp.ModuleBase.GetBusinessClassesCore()
at DevExpress.ExpressApp.ModuleBase.get_BusinessClasses()
at DevExpress.ExpressApp.ApplicationModulesManager.CollectDomainComponents()
at DevExpress.ExpressApp.ApplicationModulesManager.Load(ITypesInfo typesInfo, Boolean loadTypesInfo)
at DevExpress.ExpressApp.Utils.DesignerModelFactory.CreateModelsManager(XafApplication application, String assembliesPath, IEnumerable`1& modules)
at DevExpress.ExpressApp.Design.ModelEditor.ModelLoader.LoadModel(ITypeDiscoveryService typeDiscoveryService, ITypeResolutionService typeResolutionService, String diffFileName)
at DevExpress.ExpressApp.Design.ModelEditor.EditorPane.PrivateInit(String fileName, ModelLoader modelLoader)

There is one trick to bypass this problem. It is the Windows App model editor. Every XAF app has a web and a desktop windows versions. Let us open the windows version and go to the model editor.

This editor is similar to the Visual Studio 2010 editor which is not working. You can make all configurations over there which you need to have. After saving your changes you should follow to the bin folder and open the Model.User.xafml file. In this file, there will be all your changes. You can copy this changes and paste to the Model.xafml in the web and windows apps.

  • February 22,2017
  • Aleksandr Terentev