.net Desktop Runtime 8 -
// In App.xaml.cs or Program.cs using Microsoft.Win32; private static bool IsDesktopRuntimeInstalled()
if (result == MessageBoxResult.Yes)
April 13, 2026 | Read Time: 4 minutes
return installedVersion != null && new Version(installedVersion) >= new Version("8.0.4"); .net desktop runtime 8
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true Zero runtime dependencies. Works on Windows 7, 10, 11, and Server 2016+. Cons: Large file size (~70-120 MB per app). Must redeploy to update runtime. Strategy 2: Bootstrap with the Official Detector (The "User-Friendly" Way) Keep your app small (framework-dependent) but add a runtime check on startup. // In App
var result = MessageBox.Show( "This app requires .NET Desktop Runtime 8.0.4 or higher. Download now?", "Missing Runtime", MessageBoxButton.YesNo); = new Version("8.0.4")
Environment.Exit(1);