DevExpress Resource Management Mechanism
- 2 minutes to read
This topic describes how the DevExpress Resource Management mechanism manages theme resources when a project is deployed.
The DevExpress Resource Management mechanism obtains a resource path (such as ‘~/App_Themes/BlackGlass/{0}/sprite.css’) from a skin file deployed in the App_Themes theme-specific subfolder (e.g., BlackGlass). After resolving this path based on our naming convention (placeholder {0} is converted into the correct suite identifier, such as ASPxEditors), the DevExpress Resource Manager tries to find the corresponding resource file from a list of all resources available (for the current page). To generate this list, the Resource Manager searches all DLLs loaded at runtime (including DLLs within the project’s Bin folder) and enumerates all resources contained within the DLLs.
Then, if the resource file is found within the list of available resources, the Resource Manager initially tries to obtain that file from the corresponding DLL. This may fail if the required DLL was not loaded (or was dynamically unloaded), or if the major or minor DevExpress product version does not match.
If the Resource Manager fails to obtain the required resource file from a DLL, it then tries to find and load this file from the site’s App_Themes folder via a site-relative path (e.g., [website-url]/App_Themes/BlackGlass/ASPxEditors/sprite.css).
The success of this operation depends on how theme files are deployed in the project’s App_Themes folder - whether all theme files or only skin files are deployed.
If only skin files are deployed (the ASPxThemeDeployer‘s ‘Only skin files’ option is checked), then the resource file (sprite.css) is not included in App_Themes and cannot be loaded. The result is that DevExpress controls may not render properly.
Theme Deployment Troubleshooting
If you run into an issue when applying a theme, you can identify and fix it as follows:
- Check to see if the ASPxThemes.dll assembly is included in the deployed project’s Bin folder.
- Confirm if the ASPxThemes.dll assembly attributes (such as Version and PublicKeyToken) match other DevExpress assembly references.
- Check to see if the DevExpress enableThemesAssembly option is set to ‘true’ in the Web.config file’s devExpress section.
Add a reference to the ASPxThemes.dll in the Web.config assemblies section, as shown in the code below:
<add assembly="DevExpress.Web.ASPxThemes.v24.1, Version=24.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
It is not necessary to actually reference this assembly. However, it may identify an incorrect assembly version, or it might initiate forced loading of the assembly.