KB Article T928562
Visible to All Users

DevExpress WinForms Troubleshooting - Skins and Skin Editor

Cheat Sheets, Best Practices and Troubleshooting


In this article you will find information on most common issues related to the Skin Editor and custom skins.

Tip

The StyleChanged event is raised when a skin or a palette is changed. In some situations (e.g. when a Skin is changed unexpectedly), you can handle this event and check the call stack to see why a skin or a palette was changed.

Known Issues

Issue 1. An old skin project cannot be opened in the Skin Editor and the following error occurs:

  • "Failed to load the skin <> project"

Usually, this error occurs if the Skin Editor cannot add missing images into your skin while upgrading it. Please create a new ticket in our Support Center and share your skin project. If possible, share the initial skin project created in the older version. We will research the issue and do our best to assist you with resolving it.

Issue 2. A skin selected on the Project Settings Page is not applied to controls on a form.

Solution: Most likely, the issue occurs because you are using the standard or third-party Form or UserControl. In this case, the code that applies the selected skin and other project settings is not executed. We always recommend using our Forms: Forms and User Controls. If you cannot change your Form's or the UserControl's base type, call the WindowsFormsSettings.LoadApplicationSettings method to apply project settings.

Issue 3. Your project throws an error after you upgraded a custom skin created in an older version:

  • "Could not load file or assembly 'SkinName, Version=XX.X.X.X, Culture=neutral, PublicKeyToken=YYY' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"SkinName, Version=XX.X.X.X, Culture=neutral, PublicKeyToken=YYY"

Possible cause and solution: This issue may occur if the skin wasn't updated completely. To resolve this issue, do the following:

  • Open your skin in the Skin Editor.
  • If your skin project contains multiple skins, open every skin and save it.
  • Export a new skin assembly.

Issue 4. NullReferenceException occurs after upgrading to a newer version when using custom skins.

Solution: See the following help article: Why do I get the NullReferenceException after upgrading to a newer version when using custom skins?

Issue 5. NullReferenceException occurs after upgrading to a newer version when accessing skin elements in code.

Solution: Assuming that you are using the approach from the How to change one skin element in all available skins article, the most probable cause of the issue is that a skin element was removed or its name was changed. It's necessary to change the old name with a correct one.

The solution described in the How to change one skin element in all available skins uses inner APIs that may be changed in the future. That is why the correct solution here is to create a new skin by using our Skin Editor. If for some reason you cannot create a new skin, open the Skin Editor, create a custom skin and find the required Skin Element's name. Then change the old element's name to the new name in your code.

The issue is not on the Known Issues list

If the issue you are facing is not described above, try the following basic steps to troubleshoot it.

Steps

  1. Open your skin in the Skin Editor tool. To launch the Skin Editor, click the "Run Skin Editor…" item in the Visual Studio's DevExpress menu.
  2. Save your skin and generate a new skin assembly. Ensure that every skin is saved if your skin project contains multiple skins.
  3. Reference the new assembly in your project.

If the above steps didn't help or the issue is not related to a custom Skin, look for similar issues, errors and solutions in our Search Engine.
If you could not find any information about the error on the web or in our Support Center, please post a new ticket in our Support Center and share as much information as possible (call stack, steps to reproduce, your skin file, and/or project where the issue is reproducible). This information will help us determine the cause of the issue in the fastest and most straightforward way.

See also:
SVG Skins and Palettes – FAQ
How to change one skin element in all available skins
Skins
WinForms Skin Editor

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.