{"record":{"id":"10df848999205e93","repo":"chocolatey/choco","slug":"net-4-8-is-not-installed-or-may-need-a-reboot-to","errorCode":null,"errorMessage":".NET 4.8 is not installed or may need a reboot to complete installation.\nPlease install .NET Framework 4.8 manually and reboot the system.\nDownload at 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe'","messagePattern":"\\.NET 4\\.8 is not installed or may need a reboot to complete installation\\.\nPlease install \\.NET Framework 4\\.8 manually and reboot the system\\.\nDownload at 'https://download\\.visualstudio\\.microsoft\\.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu\\.exe'","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"critical","filePath":"src/chocolatey.console/Program.cs","lineNumber":327,"sourceCode":"choco feature enable --name=\"\"'disableCompatibilityChecks'\"\"\r\n\r\nOr by passing the --skip-compatibility-checks option when executing a\r\ncommand.\");\r\n        }\r\n\r\n        private static void ThrowIfNotDotNet48()\r\n        {\r\n            if (Platform.GetPlatform() == PlatformType.Windows)\r\n            {\r\n                // https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#minimum-version\r\n                const int net48ReleaseBuild = 528040;\r\n                const string regKey = @\"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full\\\";\r\n\r\n                using (var ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(regKey))\r\n                {\r\n                    if (ndpKey == null || ndpKey.GetValue(\"Release\") == null || (int)ndpKey.GetValue(\"Release\") < net48ReleaseBuild)\r\n                    {\r\n                        throw new ApplicationException(\r\n                            @\".NET 4.8 is not installed or may need a reboot to complete installation.\r\nPlease install .NET Framework 4.8 manually and reboot the system.\r\nDownload at 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe'\"\r\n                                .FormatWith(Environment.NewLine));\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n","sourceCodeStart":309,"sourceCodeEnd":338,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey.console/Program.cs#L309-L338","documentation":"Chocolatey's startup guard ThrowIfNotDotNet48 verifies that .NET Framework 4.8 (release >= 528040) is installed by reading HKLM\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full\\Release (32-bit registry view). If the key/value is missing or below 528040 on Windows, it throws an ApplicationException telling the user to install .NET 4.8 and reboot. This is a hard prerequisite: Chocolatey cannot run its managed code without the runtime.","triggerScenarios":"Running choco.exe on a Windows machine where the NET Framework 4.8 Full 'Release' DWORD is absent or < 528040 (e.g. only 4.7.x installed, or 4.8 installed but pending reboot before the registry value is finalized).","commonSituations":"Fresh Windows Server 2016/2019 or older Windows 10 images without .NET 4.8; CI/build agents based on older base images; a just-completed .NET 4.8 installer that has not yet rebooted; locked-down systems where the registry value was reset.","solutions":["Install .NET Framework 4.8 from the URL in the message (ndp48-x86-x64-allos-enu.exe) and reboot.","On Server Core / automated builds, use DISM or a provisioning step to install .NET 4.8 then reboot before invoking choco.","Upgrade to a base OS image that ships .NET 4.8 out of the box (Windows 10 1903+, Server 2022)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Probe .NET 4.8 release BEFORE invoking choco in provisioning.\nusing (var k = Microsoft.Win32.RegistryKey.OpenBaseKey(\n    Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry32)\n    .OpenSubKey(@\"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full\\\"))\n{\n    int release = (int)(k?.GetValue(\"Release\") ?? 0);\n    if (release < 528040)\n    {\n        // install ndp48 then reboot before running choco\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bake .NET 4.8 into base OS images so choco never hits this guard.","After installing .NET 4.8 unattended, reboot before invoking choco so the registry value finalizes.","Verify the 'Release' DWORD is >= 528040 in CI smoke checks."],"tags":["dotnet","runtime","windows","prerequisites","registry"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}