Skip to main content
A newer version of this page is available. .
All docs
V21.2

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.

Installer - Source Code Check Box

1. Download PDB Files

  1. Log in to your DevExpress account on devexpress.com.
  2. In the DevExpress Download Manager, download a ZIP archive with PDB files for the version(s) installed on your machine.

    Download Manager

    If you update DevExpress Components, you should download PDB files for the updated version.

  3. Unpack PDB files from the downloaded archive to a folder.

2. Register PDB Files in Visual Studio

  1. In the Visual Studio main menu, select Tools -> Options....

  2. In the invoked Options window, expand the Debugging node (1), and select Symbols (2). Click the New 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.

    VS

  3. In the Options window, select General (1) in the Debugging node. Uncheck the Enable Just My Code (2) and Step over properties and operators (Managed only) (3) checkboxes.

    VS additional settings

3. Register Source Code Path for Your Solution

  1. In the Visual Studio main menu, select Tools -> Options....

  2. In the invoked Options window, expand the Debugging node (1), and select Symbols (2).

  3. 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

VS - Source Code Path

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:

  1. Run the DevExpress Components installer.
  2. In the invoked DevExpress Components installer, click Modify.
  3. Input your credentials and click Login.
  4. Make sure that the Source Code item is checked and complete the DevExpress Components installation.

    Installer - Source Code Check Box

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

VS2010_x86_nojit.cmd

VS2010_x64_nojit.cmd

VS 2012

VS2012_x86_nojit.cmd

VS2012_x64_nojit.cmd

VS 2013

VS2013_x86_nojit.cmd

VS2013_x64_nojit.cmd

VS 2015

VS2015_x86_nojit.cmd

VS2015_x64_nojit.cmd

VS 2019

-

VS2019_x64_nojit.cmd

VS 2022

-

VS2022_x64_nojit.cmd

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.

See Also