Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Debug Scripts in Visual Studio

This topic describes how to debug scripts used within the End-User Report Designer.

Important

Report scripts are not secure and are disabled by default. We recommend that you use expression bindings instead.

  1. Open your application that contains the End-User Report Designer. Do one of the following depending on the application target framework:

    • .NET Framework – add the <system.diagnostics> section to the application’s configuration file as shown below:

      <?xml version="1.0" encoding="utf-8"?>
      <configuration>
          ...
          <system.diagnostics>
              <switches>
                  <add name="AllowDebugXtraReportScripts" value="BreakWhenDebuggerAttached"/>
              </switches>
          </system.diagnostics>
      </configuration>
      
    • .NET 8+ – create a runtimeConfig.template.json file in the application’s folder and put the following settings into this file:

      {
          "configProperties": {
              "AllowDebugXtraReportScripts": "BreakWhenDebuggerAttached"
          }
      }
      
  2. Run the application.

  3. Start Visual Studio and select Debug | Attach to Process in the toolbar.

    Attach to Process menu

  4. Select your running application in the invoked Attach to Process dialog.

    Attach To Process dialog

  5. Return to the application with the End-User Report Designer and switch to the Preview tab. This operation opens a temporary generated class with all report elements and script code in Visual Studio.

    Set breakpoint

    You can debug the script code in this tab (for example, use breakpoints). To see a file location folder, place a cursor over this file.

    File location folder tip

See Also