Troubleshoot Crashes, Errors, Unexpected Behavior
- 8 minutes to read
Identify the cause of exceptions, memory leaks, data-related issues, and other malfunctions.
General Diagnostic Checklist
The following table lists common factors that may contribute to an issue and steps to verify their impact.
Factor | Diagnostic Step |
---|---|
Execution Environment (remote app, add-in, plugin, etc.) | Run the application outside a remote environment or custom host. |
Windows Version | Test across supported Windows versions. |
Application Culture/Locale | If the issue involves text translation, formatting, or masks, test with the |
Control Inheritance | Test the base DevExpress control instead of a descendant. |
DevExpress Version | Reproduce the issue with the latest DevExpress version. |
Multithreading | Ensure thread-safe access to controls. Refer to the following help topics for more information: |
Third-Party Controls | Test without third-party controls. |
Application Crashes or Throws an Exception
To determine the cause of an exception or crash, do the following:
Activate exception handling to obtain stack trace details. Refer to the following help topic for more information: Obtain the exception’s call stack.
Check whether the call stack contains standard, DevExpress, or custom API.
Review stack traces in other threads. Do the following:
- Click the Debug | Windows | Threads menu item.
- In the Threads window, click Expand callstacks in the toolbar.
Further action depends on the APIs in the call stack:
API Source | Recommended Action |
---|---|
Custom Code | Debug the top method: set a breakpoint, step through the code, and verify variable values. |
Standard Library | Search for solutions online. |
DevExpress Libraries | Check for related bug reports in the DevExpress Support Center. Verify the issue against the latest DevExpress version. |
Application Crashes on the Client
The crash may occur if required assemblies are missing on the client machine or if an unhandled exception is thrown at runtime.
To diagnose and resolve the problem, take the following actions:
- Verify Assembly Deployment (.NET Framework)
- Use the DevExpress Assembly Deployment Tool to ensure that all required assemblies are included in the deployment package and available on the client machine.
- Verify Deployment (.NET)
- Make sure you deploy the application according to the instructions from the following Microsoft Learn help topic: .NET application publishing overview. Also, make sure the entire publish output is copied to the target machine.
- Capture Exception Details
- Handle the FirstChanceException event to log unhandled exceptions. Save the exception message and stack trace for further analysis. For example, you can use the following code:
// Place this code in the application's Main() method.
AppDomain.CurrentDomain.FirstChanceException += (sender, e) => {
System.Text.StringBuilder msg = new System.Text.StringBuilder();
msg.AppendLine(e.Exception.GetType().FullName);
msg.AppendLine(e.Exception.Message);
System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace();
msg.AppendLine(st.ToString());
msg.AppendLine();
String desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string logFilePath = String.Format("{0}\\{1}",desktopPath,"logfile.txt");
System.IO.File.AppendAllText(logFilePath, msg.ToString());
};
Option/Functionality Does Not Work
Various aspects may cause the issue. Common causes include feature limitations, unhandled exceptions, or incorrect logic in a custom descendant control.
The following steps should help identify the cause:
Check the documentation for specifics/limitations.
Tip
Click an option name in the Visual Studio Code editor and press F1 for quick navigation.
Check for exceptions: Application Crashes or Throws an Exception.
Use breakpoints to find the failure point. Verify variable values.
Comment out event handlers one by one to check if they affect the behavior.
If you use a custom descendant, replace it with the base DevExpress control.
Data Is Not Displayed/Edited/Saved
When data operations fail, the cause may range from binding issues to unhandled exceptions.
Refer to the following help topic for a list of data-related issues and solutions: DevExpress WinForms Troubleshooting - Data Binding Issues.
Start with the following steps to narrow down the cause:
Check for exceptions: Application Crashes or Throws an Exception.
Bind a standard data-aware control like
DataGridView
to the same data source and retest. If you can reproduce the issue, then it is not specific to DevExpress controls.
Memory Leaks and Out-of-Memory Exceptions
These issues commonly occur due to unreleased resources (managed or unmanaged). For example:
The system creates an object handle for each object and limits the number of handles. When objects are repeatedly created and not disposed of, the application runs out of handles and throws an exception.
Invalid GDI+ operations (for example, an attempt to access a disposed graphical object) prevent proper cleanup of handles and cause a leak.
The following help topic describes other reasons and best practices aimed to prevent leaks: Avoid memory and resource leaks.
Troubleshoot the issue as follows:
Obtain and analyze the exception’s call stack: Application Crashes or Throws an Exception. If the call stack contains API from the
System.Drawing
namespace, an invalid GDI+ operation is likely executed.To investigate memory leaks, use a .NET memory profiler. You can use the built-in VS profiler (suitable for simple cases), dotMemory, or others.
Use the Process Explorer tool to monitor the number of object handles.
Red Cross Is Displayed
The red cross indicates that the control’s paint routine failed. Possible causes and troubleshooting steps include:
- Unhandled Exceptions
- Exceptions thrown during the paint routine can abort rendering. Activate exception logging or handle the FirstChanceException event to capture details: Application Crashes or Throws an Exception.
- High Memory Consumption
- Excessive memory usage can break rendering if the system cannot allocate GDI resources. Use memory profiling to identify leaks or increased memory allocation: Memory Leaks and Out Of Memory Exceptions.
- Thread-Blocking Operations in
CustomDraw~
Event Handlers - Long-running or blocking operations in paint events can trigger additional WM_PAINT messages. To verify impact, comment out all
CustomDraw~
event handlers. Use caching or background threads to offload heavy operations. - Control Data or Settings Modified in
CustomDraw~
Events - Changes in bound data, control properties, or layout during painting can create an inconsistent state, recursive paint calls, or flickering. Always separate rendering logic from data manipulation.
- Multithreading Issues
- Rendering failures, exceptions, or race conditions may occur when controls are accessed or modified from non-UI threads without proper
Invoke
/BeginInvoke
calls. Use thread-safe patterns for UI interaction: Make thread-safe calls to Windows Forms controls. Application.DoEvents
CallsApplication.DoEvents
calls interrupt paint-related logic to process the Windows message queue, which may change the control state unexpectedly. Do not callDoEvents
inCustomDraw~
orOnPaint
methods.
Design-time Issues in Visual Studio
Design-time issues may occur for various reasons: due to version conflicts, incomplete updates, High-DPI scaling issues, etc.
Refer to the following help topic for a list of common design-time issues and solutions: Troubleshoot Design-Time Issues.
Start with the following steps to narrow down the cause:
Check for unhandled exceptions: Get Exception Call Stack Of Design-Time Errors In Visual Studio.
Disable all Visual Studio extensions and retest.
Custom Drawing Is Not Applied
Drawing changes may be ignored for the following reasons:
- The handler never sets
e.Handled
totrue
(this value blocks default painting routines). - You use the
e.Graphics
parameter’s methods with DirectX Hardware Acceleration – they are incompatible.
The following steps should help identify the cause:
Call the static WindowsFormsSettings.ForcePaintApiDiagnostics method at application startup to check for problematic drawing-related APIs (like
e.Graphics
). You can use the following code:using DevExpress.XtraEditors; using DevExpress.Utils.Diagnostics; namespace test { internal static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); WindowsFormsSettings.ForcePaintApiDiagnostics(PaintApiDiagnosticsLevel.Throw); Application.Run(new Form1()); } } }
Set the
e.Handled
parameter totrue
inCustomDraw~
event handlers to ensure default processing does not override custom logic.Use the
e.Cache
parameter or API that returns aGraphicsCache
object inCustomDraw~
event handlers to ensure compatibility with DirectX Hardware Acceleration.
Version Upgrade Issues
The following aspects may cause upgrade-related malfunctions:
- Missing assemblies, incomplete upgrade process, or outdated build artifacts
- Always use the DevExpress Project Converter and follow the upgrade steps from Upgrade Notes.
- Breaking changes
- Review breaking changes to check if any of them affects the application: Version History.
- Architecture/Version Conflict
- Ensure your DevExpress version supports your Visual Studio and Target Framework versions: Prerequisites.
Refer to the following help topic for a list of common upgrade issues and solutions: DevExpress WinForms Troubleshooting - Upgrade Projects.
Design-time Changes Are Ignored at Runtime
Modifications in the designer may not be applied if:
- The old layout is restored in code
- Look for
RestoreLayoutFrom
~ method calls and comment them out to make sure the old layout is not restored. - Runtime logic resets design-time changes
- Comment out runtime operations/event handlers to make sure they do not override design-time settings.
Contact Support
This troubleshooting guide mentions the most common issues. If none of the techniques listed here apply to your application, search the web or use the DevExpress.com Search Engine. If you cannot resolve your issue, submit a ticket to our Support Center. To help us assist you efficiently, please include:
- A small, compilable test project.
- Exception details (if applicable).
- Steps to reproduce the issue.
- Expected results.
- Any relevant screenshots, videos, or other supporting materials.