Description:1. Download the PDB files for the version that is installed on your machine. If you have two or more major versions installed, you can debug each of them. In this case, it is necessary to download PDB files for all versions installed on your machine. See the Understanding the DevExpress product versions and release dates KB article for more information on DevExpress .NET product versioning.
I know that the Visual Studio compiler generates PDB files for assemblies and I can use them for debugging. Is it possible to get PDB files for DevExpress assemblies to debug them?
Yes, it is possible. We provide PDB files starting with version 13.1. If you have a subscription that includes our source code (Universal or DXperience), these files are available for download from your Download Manager.
Perform the following steps to include PDB files when debugging:
If you upgrade your product version, you will need to download a new version of PDB files as well.
2. Register a path to the PDB files in the Visual Studio Options dialog window. To access this window, select Tools -> Options... in the main menu. In the invoked Options window, expand the Debugging node and select Symbols, as illustrated in the image below.
Note that if you need to debug our Silverlight assemblies, the folder that contains PDB files for them is located in the Silverlight folder of the downloaded archive.
After this, you will be able to debug the source code. Click the F11 key to execute the "Step Into" command. See the Debugging in Visual Studio MSDN article for more information.
When you navigate to our code, Visual Studio will ask you for a source code file. You will see the following dialog:
At the top, this dialog shows a path to the source code file as it was compiled on our side. It is necessary to locate the same file on your machine. For example, in this dialog, Visual Studio asks me for the C:\Projects\13.1\BuildLabel\Temp\NetStudio.v13.1.2005\Win\DevExpress.XtraBars\DevExpress.XtraBars\Ribbon\Ribbon.cs file. Thus, it is necessary to point Visual Studio to the DevExpress.XtraBars\DevExpress.XtraBars\Ribbon\Ribbon.cs file in the folder in which you installed our source code. For example, for version 13.1 installed on an x86 OS, the default path is C:\Program Files\DevExpress\DXperience 13.1\Sources, and on an x64 OS the default path is C:\Program Files (x86)\DevExpress\DXperience 13.1\Sources. Thus, if my OS is 64-bit, I need to navigate to the C:\Program Files (x86)\DevExpress\DXperience 13.1\Sources\DevExpress.XtraBars\DevExpress.XtraBars\Ribbon folder to get the required file. Once you have navigated to a folder containing the source file, Visual Studio closes the dialog automatically.
Note that particular paths to our source files can differ from a file structure on your machine. Usually, it does not cause any issues since Visual Studio "remembers" locations of previously loaded source files and does not prompt you each time you debug their code.
You can avoid searching for source files each time if you set the source code locations for your solution in Visual Studio (see the Specify symbol (.pdb) and source files in the Visual Studio debugger article). Usually, it is enough to add the *C:\Program Files (x86)\DevExpress 17.1\Components\Sources* path. It might be necessary to also add the *C:\Program Files (x86)\DevExpress 17.1\Components\Sources\DevExpress.ExpressApp* path if you need to debug XAF. Since these settings are saved in the *.suo file, you need to do this only once per application solution.
For improved debugging, I suggest disabling the "Enable Just My Code" and "Step over properties and operators (Managed only)" options. To access these options, select Tools -> Options... in the main menu. In the invoked Options window, expand the Debugging node and select General, as shown in the image below.
During the debugging process, you may be unable to watch local variables. This occurs because of debug optimization. To avoid this side-effect, run Visual Studio with COMPLUS_ZapDisable set to 1, and disable "Enable the Visual Studio Hosting Process" in the project properties:
NOTE: The latter option has been removed in Visual Studio 2017, so skip it. You may also want to check the JIT Optimization and Debugging settings, How to disable optimizations when debugging Reference Source and How to: Disable the Hosting Process articles for more information about debugging optimizations.
In the attachment to this article, you will find CMD files that run Visual Studio with the required key. Run the file that is appropriate for your VS and OS versions. The files run Visual Studio from its default location. If your Visual Studio is installed in another folder, edit the file to provide the correct path.
You may also not monitor the values of local variables if Visual Studio is run as Administrator where the "Run as Administrator" option is set via the "devenv.exe" file properties on the "Compatibility" tab. Check this option and disable it if it's enabled.
1) I cannot find the required source files. Can I trace the code of some of the products?
Please be sure to select "Source Code" when installing our products. If you did not do this, run our installer in Repair mode and choose the corresponding option. If you do not see it, make sure that you are assigned a license for our Universal or DXperience Subscription, which includes the source code.
Also note that we provide source code for Dashboard starting from version 14.1.
2) The cursor is positioned on a code line that does not match the call stack.
This may occur if you have not disabled debug optimization. To do this, run Visual Studio with COMPLUS_ZapDisable set to 1 (you can use the CMD files attached to this article) and disable the "Enable the Visual Studio Hosting Process" option in the project’s Properties -> Debug window. Note that you may have a source row selected that is the row next to the method shown in a call stack. This side-effect is due to the fact that our assemblies were built in Release configuration. You will see the same behavior if you build your project in Release configuration and navigate through its methods.
3) I cannot inspect a local variable value.
This also occurs due to debug optimization. See the previous paragraph to resolve the issue.
4) Why does Visual Studio show the following warning: "The source file is different from when the module was built."?
This happens when the PDB file version is different from the source code version. For example, it may occur when you’ve upgraded your DXperience version, but have not yet downloaded new PDB files. Refer to the Q288305: Understanding the DevExpress product versions and release dates KB article for more information on DevExpress .NET product versioning.
Show all comments