Debug Qt Bridge for C# applications
You can debug the QML code of a Qt Bridge for C# application with the QML debugger of Qt Extension for Visual Studio Code. To debug the C# code, use the debugger of the C# Dev Kit extension.
Before you start debugging, build the application. For more information, see Build and run Qt Bridge for C# applications.
Debug QML code
Projects that you create from the Qt Bridge for C# application template have a QML debugger configuration in the .vscode/launch.json file. To debug the QML code of the application, select the Qt Bridge: QML debug configuration, and start debugging.
For other projects, add the configuration to the launch.json file of the project. For more information, see Debug Qt applications. The configuration uses ${command:qt-csharp.launchTargetPath} as the program:
"configurations": [
{
"name": "Qt Bridge: QML",
"type": "qml",
"request": "launch",
"program": "${command:qt-csharp.launchTargetPath}"
}
]The command resolves the executable of the project that contains the file in the editor, or asks you to select a project if there are several. It does not build the project. If you built the project in several configurations or for several target frameworks, select the build to use with Qt Bridge C#: Select QML Build Metadata.
When the debugger stops, the editor shows the QML files of your project, not the copies that the build makes of them.
Note: Breakpoints in QML code that runs right when the application starts can be missed.
For more information about debugging QML code, such as attaching to a running application, see Debug Qt Quick applications.
Debug C# code
To debug the C# code of the application, install the C# Dev Kit extension, and start the C# debugger from the Solution Explorer view: right-click the project, and select Debug. If the project has a QML debugger configuration, F5 starts the QML debugger instead.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.