Debug DevExpress .NET Source Code with PDB Files
- 4 minutes to read
Universal or DXperience subscriptions include PDB files that allow you to debug DevExpress .NET Components referenced in your applications.
Make sure that the Source Code check box is checked when you install the DevExpress Components. Refer to the following section for more information: I cannot find the source files.
1. Download PDB Files
- Log in to your DevExpress account on devexpress.com.
In the DevExpress Download Manager, download a ZIP archive with PDB files for the version(s) installed on your machine.
If you update DevExpress Components, you should download PDB files for the updated version.
Unpack PDB files from the downloaded archive to a folder.
2. Register PDB Files in Visual Studio
In the Visual Studio main menu, select
Tools
->Options...
.In the invoked
Options
window, expand theDebugging
node (1), and selectSymbols
(2). Click theNew Location
button (3) and paste the path to the folder with PDB files (4).PDB file paths depend on the framework you use in the application:
- .NET Framework: DX_PDB
- .NET Core: DX_PDB/NETCORE
- .NET Standard: DX_PDB/STANDARD
- UWP: DX_PDB/UWP
In the sample below, PDB files are located in the DX_PDB folder.
In the
Options
window, selectGeneral
(1) in theDebugging
node. Uncheck theEnable Just My Code
(2) andStep over properties and operators (Managed only)
(3) checkboxes.
3. Register Source Code Path for Your Solution
In the Visual Studio main menu, select
Tools
->Options...
.In the invoked
Options
window, expand theDebugging
node (1), and selectSymbols
(2).- Click the
New Location
button (3) and paste the path to source code files (4). The path to source code files is saved in the*.suo
file, and you should specify this path for each solution where you want to debug DevExpress Components. Refer to the following topic for more information: Specify symbol (.pdb) and source files in the Visual Studio debugger.
The default source code file paths for the DevExpress Components v14.1-v21.2 are as follows:
x86 OS: C:\Program Files\DevExpress (version)\Components\Sources
x64 OS: C:\Program Files (x86)\DevExpress (version)\Components\Sources
If you need to debug XAF, use the following source file paths:
x86 OS: C:\Program Files\DevExpress (version)\Components\Sources\DevExpress.ExpressApp
x64 OS: C:\Program Files (x86)\DevExpress (version)\Components\Sources\DevExpress.ExpressApp
4. Debug
Your application is ready to debug DevExpress Components. Set a breakpoint anywhere in DevExpress code and run your application in the Debug configuration. Press F11 to step into DevExpress Components source code.
Refer to the following topic for more information: Visual Studio debugger documentation.
Troubleshooting
I cannot find the source files
This issue may happen if the Source Code check box was unchecked when you installed DevExpress Components. Follow the steps below to modify the DevExpress Components installation and enable Source Code:
- Run the DevExpress Components installer.
- In the invoked DevExpress Components installer, click Modify.
- Input your credentials and click Login.
Make sure that the Source Code item is checked and complete the DevExpress Components installation.
If you do not see the Source Code checkbox, make sure that you have the Universal or DXperience Subscription license.
I cannot inspect a local variable value
Visual Studio may display the following message:
Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away.
JIT optimization may have a side effect that does not allow you to watch local variables. Refer to the following topic for more information on debugging optimization: JIT Optimization and Debugging.
To ignore native images compiled with the Ngen.exe
, you can use scripts listed in the following table:
Visual Studio Version | OS Architecture | |
---|---|---|
x86 | x64 | |
VS 2010 | ||
VS 2012 | ||
VS 2013 | ||
VS 2015 | ||
VS 2019 | - | |
VS 2022 | - |
The cursor is positioned on a code line that does not match the call stack
This issue may occur if you have not disabled debugging optimization. Refer to the previous section to fix the issue.
Visual Studio warning: “The source file is different from when the module was built.”
This issue may happen if the PDB file and source code file versions are different. For example, when you updated a version of your DevExpress Components, but have not yet downloaded PDB files for the updated version.
Refer to the following section for more information on how to download PDB files: Download PDB Files.