files-community/Files · critical · InvalidOperationException

Files failed to start. A required Windows component could no

Error message

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

What it means

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.

Source

Thrown at src/Files.App/Program.cs:142

			// Now we can do the first WinRT server call
			//Server.AppInstanceMonitor.StartMonitor(Environment.ProcessId);

			var OpenTabInExistingInstance = ApplicationData.Current.LocalSettings.Values.Get("OpenTabInExistingInstance", true);

			AppActivationArguments activatedArgs;
			try
			{
				activatedArgs = AppInstance.GetCurrent().GetActivatedEventArgs();
			}
			catch (COMException ex) when (ex.HResult == unchecked((int)0x80040154))
			{
				Windows.Win32.PInvoke.MessageBox(
					default,
					Constants.Startup.MissingRuntimeMessage,
					Constants.Startup.MissingRuntimeTitle,
					MESSAGEBOX_STYLE.MB_ICONERROR);

				throw new InvalidOperationException(Constants.Startup.MissingRuntimeMessage, ex);
			}

			var commandLineArgs = GetCommandLineArgs(activatedArgs);

			if (commandLineArgs is not null)
			{
				var parsedCommands = CommandLineParser.ParseUntrustedCommands(commandLineArgs);

				if (parsedCommands is not null)
				{
					foreach (var command in parsedCommands)
					{
						switch (command.Type)
						{
							case ParsedCommandType.ExplorerShellCommand:
								if (!Constants.UserEnvironmentPaths.ShellPlaces.ContainsKey(command.Payload.ToUpperInvariant()))
								{
									OpenShellCommandInExplorer(command.Payload, Environment.ProcessId);

View on GitHub (pinned to 68c68a58d4)

Solutions

  1. Install/repair the Windows App SDK runtime from the Microsoft Store or https://aka.ms/windowsappsdk/
  2. Reinstall Files from the Microsoft Store or https://files.community/download so MSIX registration is repaired.
  3. For unpackaged deployments, register the runtime via WindowsAppRuntimeInstall.exe.
  4. Ensure the Windows version meets the minimum requirement (1809+/build 17763+ for the relevant SDK).
  5. Run the app as the correct user context; per-user MSIX registration can be missing for other accounts.
Defensive patterns

Strategy: fallback

Validate before calling

// Not applicable at runtime in-process; the runtime is missing. Validate environment:
// Confirm Windows App SDK runtime is registered before launch (admin/installer context).
// Check for the redistributable presence and Windows build version >= minimum supported.

Try / catch

try { Activator.CreateInstance(Type.GetTypeFromProgID("Windows.Internal.Runtime")); }
catch { /* runtime missing - install Windows App SDK */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.


AI-assisted analysis of files-community/Files@68c68a58d4 (2026-08-13). Data as JSON: /api/errors/ee35b63f0caf7c9d. Report an issue: GitHub.