{"record":{"id":"ee35b63f0caf7c9d","repo":"files-community/Files","slug":"files-failed-to-start-a-required-windows-componen","errorCode":null,"errorMessage":"Files failed to start. A required Windows component could not be loaded. Try reinstalling Files from the Microsoft Store or from https://files.community/download","messagePattern":"Files failed to start\\. A required Windows component could not be loaded\\. Try reinstalling Files from the Microsoft Store or from https://files\\.community/download","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Files.App/Program.cs","lineNumber":142,"sourceCode":"\t\t\t// Now we can do the first WinRT server call\n\t\t\t//Server.AppInstanceMonitor.StartMonitor(Environment.ProcessId);\n\n\t\t\tvar OpenTabInExistingInstance = ApplicationData.Current.LocalSettings.Values.Get(\"OpenTabInExistingInstance\", true);\n\n\t\t\tAppActivationArguments activatedArgs;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tactivatedArgs = AppInstance.GetCurrent().GetActivatedEventArgs();\n\t\t\t}\n\t\t\tcatch (COMException ex) when (ex.HResult == unchecked((int)0x80040154))\n\t\t\t{\n\t\t\t\tWindows.Win32.PInvoke.MessageBox(\n\t\t\t\t\tdefault,\n\t\t\t\t\tConstants.Startup.MissingRuntimeMessage,\n\t\t\t\t\tConstants.Startup.MissingRuntimeTitle,\n\t\t\t\t\tMESSAGEBOX_STYLE.MB_ICONERROR);\n\n\t\t\t\tthrow new InvalidOperationException(Constants.Startup.MissingRuntimeMessage, ex);\n\t\t\t}\n\n\t\t\tvar commandLineArgs = GetCommandLineArgs(activatedArgs);\n\n\t\t\tif (commandLineArgs is not null)\n\t\t\t{\n\t\t\t\tvar parsedCommands = CommandLineParser.ParseUntrustedCommands(commandLineArgs);\n\n\t\t\t\tif (parsedCommands is not null)\n\t\t\t\t{\n\t\t\t\t\tforeach (var command in parsedCommands)\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch (command.Type)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase ParsedCommandType.ExplorerShellCommand:\n\t\t\t\t\t\t\t\tif (!Constants.UserEnvironmentPaths.ShellPlaces.ContainsKey(command.Payload.ToUpperInvariant()))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tOpenShellCommandInExplorer(command.Payload, Environment.ProcessId);","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/files-community/Files/blob/68c68a58d4d6a5f7197e07c8fff85cfd4279c78b/src/Files.App/Program.cs#L124-L160","documentation":"Thrown by Program.cs during startup as InvalidOperationException, wrapping a COMException with HRESULT 0x80040154 (REGDB_E_CLASSNOTREG). The trigger is AppInstance.GetCurrent().GetActivatedEventArgs() failing because the Windows App SDK / WinUI 3 runtime is not registered on the machine. A MessageBox is shown first, then the exception terminates launch.","triggerScenarios":"Launching Files on a machine where the Windows App SDK runtime (or its packaged dependencies) is not installed/registered. HRESULT 0x80040154 specifically means the required WinRT class is not registered. Common after a clean Windows install, an interrupted SDK install, a failed MSIX registration, or running an unpackaged binary without the redistributable.","commonSituations":"Fresh OS without the Windows App Runtime; side-loading an unpackaged build without installing the runtime; partial uninstall that left class registrations broken; Windows version below the minimum required by the bundled SDK.","solutions":["Install/repair the Windows App SDK runtime from the Microsoft Store or https://aka.ms/windowsappsdk/","Reinstall Files from the Microsoft Store or https://files.community/download so MSIX registration is repaired.","For unpackaged deployments, register the runtime via WindowsAppRuntimeInstall.exe.","Ensure the Windows version meets the minimum requirement (1809+/build 17763+ for the relevant SDK).","Run the app as the correct user context; per-user MSIX registration can be missing for other accounts."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Not applicable at runtime in-process; the runtime is missing. Validate environment:\n// Confirm Windows App SDK runtime is registered before launch (admin/installer context).\n// Check for the redistributable presence and Windows build version >= minimum supported.","typeGuard":null,"tryCatchPattern":"try { Activator.CreateInstance(Type.GetTypeFromProgID(\"Windows.Internal.Runtime\")); }\ncatch { /* runtime missing - install Windows App SDK */ }","preventionTips":["Ship/install the Windows App SDK runtime as a dependency (MSIX or WindowsAppRuntimeInstall).","Keep Windows updated to a build that supports the bundled SDK.","Repair MSIX registration on corrupted installs via the Store or reinstall.","Run as the user who installed the per-user MSIX runtime."],"tags":["startup","winui","runtime","com","windows-app-sdk"],"backgroundTag":null,"analyzedSha":"68c68a58d4d6a5f7197e07c8fff85cfd4279c78b","analyzedAt":"2026-08-13T10:34:54.614Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}