You’re in a tricky but very common situation: legacy WPF apps on .NET Framework 4.5.2 + ClickOnce + an old TFS server that you want to retire. The good news is: you can build and publish ClickOnce from GitHub Actions using a self-hosted runner, but you must configure the runner correctly because GitHub’s hosted runners don’t support this scenario at all.
Here is a practical and realistic approach I’d recommend: Use a Windows Self-Hosted Runner with the old build toolchain installed
ClickOnce publishing for .NET Framework requires MSBuild + specific Visual Studio components that don’t exist in GitHub’s hosted runners. You need to replicate the environment TFS was using.
Install on your self-hosted runner:
Visual Studio 2019 or 2022 with:
.NET Desktop Development workload
**MSBuild** and legacy targeting packs
**.NET Framework 4.5.2 Developer Pack**
The same version of the Windows SDK used in the old TFS pipeline
Once installed, GitHub Actions can run:
- name: Publish ClickOnce
run: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe" YourApp.csproj /p:PublishProfile=YourClickOnceProfile.pubxml /p:Configuration=Release'
This works because ClickOnce is MSBuild-driven, not GitHub-driven.
Important:
If the TFS server had custom MSBuild .targets or signing certificates, copy them too.