.net Desktop Runtime 8 Work May 2026
Use Microsoft's official WindowsDesktop.Runtime NuGet package to detect the exact required version:
Environment.Exit(1);
return installedVersion != null && new Version(installedVersion) >= new Version("8.0.4"); .net desktop runtime 8
// In App constructor or Main() if (!IsDesktopRuntimeInstalled())
Mastering the .NET Desktop Runtime 8: Solving the "Missing Runtime" Nightmare for Good Use Microsoft's official WindowsDesktop
// In App.xaml.cs or Program.cs using Microsoft.Win32; private static bool IsDesktopRuntimeInstalled()
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")
const string runtimeKey = @"SOFTWARE\dotnet\Setup\InstalledVersions\x64\sharedfx\Microsoft.WindowsDesktop.App"; using var key = Registry.LocalMachine.OpenSubKey(runtimeKey); var installedVersion = key?.GetValue("Version") as string;