BCUninstaller/Bulk-Crap-Uninstaller · error · IOException

{deploymentResult.ErrorText}

Error message

{deploymentResult.ErrorText}

What it means

An IOException thrown by `AppManager.UninstallApp` when a `PackageManager.RemovePackageAsync` operation completes with `AsyncStatus.Error`. The exception message is the raw `DeploymentResult.ErrorText` returned by the Windows deployment stack, which typically describes why the package could not be removed (permissions, package in use, not found, policy). The original `ErrorCode` is printed to console but not wrapped into the exception.

Solutions

  1. Ensure the app is fully closed before uninstalling (check Task Manager).
  2. Pass the exact full package name (e.g. from `AppManager.QueryApps()` output).
  3. Run the operation with sufficient privileges; some packages require administrator.
  4. Read the printed Error code/Error text to identify the specific Win32 deployment failure.
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate the package exists and is removable before uninstalling.
var existing = AppManager.QueryApps().FirstOrDefault(a => a.Id.FullName == fullName);
if (existing == null) throw new InvalidOperationException($"Package {fullName} not found.");

Try / catch

try { AppManager.UninstallApp(fullName); }
catch (IOException ex)
{
    // ex.Message is the DeploymentResult.ErrorText
    if (ex.Message.Contains("deployment") || ex.Message.Contains("in use"))
        /* prompt user to close the app and retry */
}

Prevention

When it happens

Trigger: Uninstalling a Store/MSIX package that is currently running, owned by another user, protected by policy, already removed, or whose full package name is malformed/incorrect.

Common situations: Passing a partial or wrong package family name; app still running in the background; system/protected package that cannot be user-uninstalled; package installed for a different user account.

Related errors


AI-assisted analysis of BCUninstaller/Bulk-Crap-Uninstaller@608321de98 (2026-08-13). Data as JSON: /api/errors/fd90260b1089f238. Report an issue: GitHub.

Appendix: source

Thrown at source/StoreAppHelper/AppManager.cs:44

            var packageManager = new PackageManager();

            var deploymentOperation = packageManager.RemovePackageAsync(fullName);

            var opCompletedEvent = new ManualResetEvent(false);
            deploymentOperation.Completed += (info, status) => opCompletedEvent.Set();

            Console.WriteLine($"Uninstalling \"{fullName}\"");

            opCompletedEvent.WaitOne();

            // Check the status of the operation
            switch (deploymentOperation.Status)
            {
                case AsyncStatus.Error:
                    var deploymentResult = deploymentOperation.GetResults();
                    Console.WriteLine(@"Error code: {0}", deploymentOperation.ErrorCode);
                    Console.WriteLine(@"Error text: {0}", deploymentResult.ErrorText);
                    throw new IOException(deploymentResult.ErrorText);

                case AsyncStatus.Canceled:
                    Console.WriteLine(@"Uninstallation was cancelled");
                    throw new OperationCanceledException();

                case AsyncStatus.Completed:
                    Console.WriteLine(@"Uninstallation completed successfully");
                    return;

                default:
                    Console.WriteLine(@"Invalid status: {0}", deploymentOperation.Status);
                    throw new IOException();
            }
        }

        public static IEnumerable<App> QueryApps()
        {
            var packageManager = new PackageManager();

View on GitHub (pinned to 608321de98)