Build and run Qt Bridge for C# applications
A Qt Bridge for C# project is a regular .NET project. Build and run it with the .NET command-line tools or with C# Dev Kit.
Before you build, make sure that the build finds a Qt installation. For more information, see Select Qt for Qt Bridge for C# projects.
The first build takes longer, because it also generates and builds the native code that connects C# and QML.
Build in the terminal
To build and run the application, enter the following commands in the Terminal view:
dotnet build dotnet run
To build a particular configuration, add -c, for example dotnet build -c Release.
Build with C# Dev Kit
If you installed the C# Dev Kit extension, you can also build the project from the Solution Explorer view: right-click the project, and select Build. To run or debug the application with the C# debugger, right-click the project, and select Debug.
C# Dev Kit builds the project outside the Terminal view, so it does not get the Qt Dir setting. On Windows ARM64, Linux, and macOS, set the QtDir environment variable before you start VS Code, or set QtDir in the project.
Debug the application
To debug the QML code of the application with the QML debugger, or the C# code with C# Dev Kit, see Debug Qt Bridge for C# applications.
Use the QML tools after the build
The build generates metadata that the QML language server, QML Preview, and QML Profiler need for your C# types and QML modules. After the first build, the code completion in QML files knows the types that you expose from C#.
If you build the project in several configurations or for several target frameworks, select the build that the QML tools should use. For more information, see Preview and profile Qt Bridge for C# applications.
See also Tutorial: Qt Bridge for C#.
© 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.