1. Decide about the .NET runtime
A .NET app needs the .NET runtime. You can handle that in two ways:- Self-contained: the runtime is part of your build folder. Users need nothing else. The setup file gets bigger.
- Framework-dependent: your app is small, but the right .NET runtime must be installed on the user’s computer. Bach can check for it and tell the user where to get it.
2. Publish
- Self-contained
- Framework-dependent
bin/Release/<framework>/win-x64/publish, for example bin/Release/net8.0-windows/win-x64/publish.
3. Create bach.toml
Run this in the folder with your.csproj:
Product or the assembly name, Version, Company or Authors, and the target framework. For a WPF app on .NET 8 you get (without the commented-out options):
bach.toml
Bach 0.11.3 and earlier wrote the block uncommented. If you publish self-contained, delete it, or the installer asks users to install a runtime your app already carries.
desktop = true checks for the .NET Desktop Runtime, which WPF and Windows Forms apps need. It’s set when your target framework ends in -windows.