Debug DevExpress .NET Source Code with Debug Symbols
- 2 minutes to read
Follow the steps below to prepare your environment for debugging DevExpress Components.
To install debug symbols, check the Source Code option when you install DevExpress Components.
When this option is enabled, the installer installs DevExpress components’ source and symbol files, and registers symbol files in Visual Studio for the current user:
Navigate to Debug | Options and uncheck “Enable Just My Code”.
Specify a path with the DevExpress sources in your solution properties: right-click the solution and navigate to Properties | Common Properties | Debug Source Files. Add a source to the DevExpress Component sources.
Refer to the following Microsoft article for more information: Specify symbol (.pdb) and source files in the Visual Studio debugger
Now, your environment 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.
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
Ngen.exe, you can use scripts listed in the following table:
Visual Studio Version
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.