How to sign a .NET app and its MSI
Install the global tool with dotnet tool install -g BambooDeploy.Sign, then run bamboo-sign sign on the published exe. An MSBuild target after Publish makes every Release publish come out signed. It works for WPF, WinForms, WinUI, console apps and PublishSingleFile builds. If you ship an MSI, sign the exe first, build the MSI, then sign the MSI.
1. Install the tool and set your API key
dotnet tool install -g BambooDeploy.Sign
Create a key in the dashboard under API Keys. It starts with bd_live_. Save it for your Windows user, then open a new terminal or restart Visual Studio so it sees the new variable:
setx BAMBOO_API_KEY bd_live_...
A .bamboorc file in your user folder with the line BAMBOO_API_KEY=bd_live_... works too.
The tool needs the .NET 8 runtime. It does not need Node.
2. Sign after publish
dotnet publish -c Release -r win-x64
bamboo-sign sign bin\Release\net8.0\win-x64\publish\MyApp.exe
With PublishSingleFile there is one exe to sign, and its signature covers the bundled assemblies inside it. In a framework-dependent publish your code lives in MyApp.dll next to the exe: add it to the command.
3. Sign on every Release publish
Add this target to the .csproj. It runs after Publish, only for Release, and only when the key is set, so machines without a key still build:
<Target Name="BambooSign" AfterTargets="Publish" Condition="'$(Configuration)' == 'Release' And '$(BAMBOO_API_KEY)' != ''">
<Exec Command="bamboo-sign sign "$(PublishDir)$(AssemblyName).exe"" />
</Target>
Prefer a Visual Studio post-build event? Use bamboo-sign sign "$(TargetPath)" on the Release configuration only.
4. Sign the MSI
An MSI packs your exe, so the order matters: sign the exe, build the MSI from the signed file, then sign the MSI. In a WiX SDK project, add a target to the .wixproj, where $(TargetPath) is the finished MSI:
<Target Name="BambooSignMsi" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
<Exec Command="bamboo-sign sign "$(TargetPath)"" />
</Target>
With a Visual Studio Installer Project, run bamboo-sign sign on the .msi after it is built, for example in your release script.
Smart App Control
On Windows 11 with Smart App Control on, a blocked program has no Run anyway button. Smart App Control lets a file with a valid signature run, and it checks every exe and DLL as it loads, not only the file the user downloaded. Sign the exe, every DLL of your own that ships next to it, and the MSI.
Common errors
MSBuild reports a failed sign step as error MSB3073: The command "bamboo-sign sign ..." exited with code N:
| Exit code | Meaning | What to do |
|---|---|---|
| 1 | Bad or missing API key, file not found, or signing denied or failed | Read the printed message. Check BAMBOO_API_KEY and the file path. |
| 2 | Signing needs a Premium plan | Upgrade in the dashboard. |
| 3 | Fewer than two verified connections | Verify your email plus a domain, GitHub or similar under Connections in the dashboard. |
| 4 | Timed out waiting for the signature | The build may be waiting for review. Run the same command again once it is approved. |
'bamboo-sign' is not recognized, or code 9009 from MSBuild, means the tools folder is not on PATH. It is %USERPROFILE%\.dotnet\tools: add it, or call the tool by its full path.
FAQ
Does signing break a single-file app?
No. Sign after publish, never before. The signature covers the whole file, bundled assemblies included.
Does it work in GitHub Actions or Azure Pipelines?
Yes. Run dotnet tool install -g BambooDeploy.Sign in the job, set BAMBOO_API_KEY from a secret, and call bamboo-sign sign after publish. The tool runs on Windows, Linux and macOS agents.
Whose name does Windows show as the publisher?
Ours. We sign your build with our EV code signing certificate, so Windows shows our verified publisher name instead of Unknown publisher. You need no certificate, company registration or USB token of your own.
Does signing remove the SmartScreen warning at once?
Not on its own. A valid signature replaces Unknown publisher with a verified publisher, and Smart App Control lets a signed file run. SmartScreen also weighs reputation, which builds as people download and run your files, and no certificate grants it instantly, EV included. See EV certificates no longer skip SmartScreen.
What do I need before I can sign?
A Bamboo Deploy account, an API key from the dashboard, a Premium plan and two verified connections: your email plus a domain, GitHub or similar. Uploading and scanning are free.
Bamboo Deploy scans every build and signs it with our EV certificate, so you need no certificate, no company registration and no USB token of your own. Get started, or read the docs.