Fix: “AppxPackage: The Remote Procedure Call Failed” Error in Windows

The error “AppxPackage: The Remote Procedure Call Failed” often occurs when you attempt to remove or manage apps using PowerShell. This is primarily caused by issues with the Remote Procedure Call (RPC) service, a crucial component for performing key Windows operations. When this service is not running or is misconfigured, it disrupts app removal or installation processes. Another potential cause is problems with the Windows registry, where missing or corrupted entries can stop commands like AppxPackage from working as intended.

Outdated Windows versions, incomplete updates, or issues with the AppX Deployment Service may also trigger this error, especially when the system fails to properly handle app packages. A corrupted user profile can likewise cause problems with app removal or executing certain commands.

1. Verify and Restart the Remote Procedure Call (RPC) Service

  1. Press Win + R, type Services.msc, and hit Enter. This will open the Services window.
  2. Scroll to find Remote Procedure Call (RPC) in the list.
  3. Ensure that its Status is Running and the Startup Type is set to Automatic.
  4. If it’s running, right-click and select Restart. If it’s stopped, right-click and select Start.
    RPC is a critical service with many dependencies, usually protected to prevent accidental misconfigurations. If you find it’s stopped or not set to Automatic, you can safely adjust it to ensure functionality.
  5. Click OK to save any changes, close the Services window, and restart your system to apply the fix.

2. Run PowerShell with Elevated Permissions

Running PowerShell with elevated permissions ensures that you have full access to modify system settings or uninstall apps, which might otherwise be blocked by permission issues.

  1. Press Win + X and select Windows PowerShell (Admin) or Command Prompt (Admin) from the menu.
  2. If prompted by User Account Control, click Yes to allow it.
  3. Once PowerShell opens, enter your desired command and press Enter.

After executing this, try the AppxPackage command again. If the issue persists, proceed to the next step.

3. Use Safe Mode to Remove the Appx Package

Booting your computer into Safe Mode can help troubleshoot and resolve issues by loading only essential drivers and services, avoiding conflicts with third-party apps and software. If you’re still experiencing the “AppxPackage: The Remote Procedure Call Failed” error, Safe Mode may allow the system to remove the app.

  1. Press Win + R, type msconfig and hit Enter.
  2. In the System Configuration window, go to the Boot tab.
  3. Check the Safe boot option and select Minimal.
  4. Click OK, then Restart your PC when prompted.
  5. After your PC restarts in Safe Mode, try executing the AppxPackage command again.

To Exit Safe Mode, repeat these steps and uncheck the Safe boot option, then restart your system. If you still don’t understand, you can try our detailed guide on how to exit safe mode in Windows.

4. Reset or Reinstall Problematic Windows Applications (Optional)

If the app is installed and causing issues, consider resetting or reinstalling it via the Apps & Features settings.

  1. Open Settings and navigate to Apps > Apps & Features/Installed Apps.
    Find the app causing the issue.
  2. Click on the app and select Advanced options.
  3. If you see a Reset button, click it to restore the app to its default state, possibly resolving the error.
  4. If resetting doesn’t work, uninstall and reinstall the app through the Apps & Features menu.
This step is optional and mainly applies to users experiencing problems with an already installed app. For those encountering the error while using PowerShell to uninstall or install apps, simply retrying the command might resolve the issue.

5. Check System Integrity with SFC and DISM Tools

Sometimes, system integrity issues can cause the “AppxPackage: The remote procedure call failed” error. Running the built-in SFC (System File Checker) and DISM (Deployment Imaging Service and Management Tool) can fix corruption in system files and the Windows Image, potentially unblocking the app removal process.

Run SFC Tool:

  1. Press Win + X and select Command Prompt (Admin) or Windows PowerShell (Admin) to open with administrator rights.
  2. In the Command Prompt, type the following command and press Enter:
    sfc /scannow

  3. Wait for the scan to finish. This will automatically fix any corrupted system files it detects.
  4. Restart your PC if it finds any corrupted files.

Run DISM Tool:

  1. If the SFC tool didn’t resolve the issue, open Command Prompt (Admin) again.
  2. Type the following command and press Enter:
    DISM /Online /Cleanup-Image /RestoreHealth

  3. Wait for DISM to repair the system image. This process might take several minutes.
  4. Once done, restart your system and check if the issue persists.

6. Create a New User Profile

If none of the previous steps have fixed the issue, a corrupted user profile might be the root cause. Sometimes, errors like “AppxPackage: The remote procedure call failed” only appear on a specific user profile due to profile corruption. Creating a new user profile can help test if the issue is tied to your current profile.

If you don’t have the necessary permissions, you may not be able to create a new admin account. If the issue resolves with the new user profile, back up your important data from the old account before removing it.
  1. Open Settings by pressing Win + I.
  2. Go to Accounts and select Other users.
  3. Under Other users, click Add Account.
  4. Follow the prompts to create a new Microsoft account or a local user account.
  5. After creating the account, click on the account and Change account type.
  6. Change the account type from Standard User to Administrator.
  7. Sign out of your current profile and sign in to the new one.
  8. Try running PowerShell to see if the error still occurs.

If the issue is resolved on the new profile, your original profile might be corrupted, and you can transfer your data to the new account.

7. Check System Language and App Bundles

If your system uses a non-English language or has specific regional settings, app bundles might be complicating the removal or installation process. To address this, use the -PackageTypeFilter parameter with PowerShell to target all components of the app, including its bundles.

Command:

Get-AppxPackage -AllUsers -Name "*appname*" | AppxPackage -AllUsers -Confirm

This command ensures that all related app bundles are included for removal. Remember to replace appname with the actual name of the app you’re facing issues with.

8. Use SetACL Tool (For Advanced Users Only)

If the Remote Procedure Call service is running but you still face issues, it might be due to third-party tools corrupting or misconfiguring registry entries linked to AppX packages. This step is for advanced users, as this error often appears after using cleanup software or the system file checker. Corrupted files can disrupt the process, leading to the “Remote Procedure Call Failed” issue. For this, we’ll use the SetACL tool.

SetACL is a command-line utility for managing file and registry permissions on Windows. It allows advanced control over access control lists (ACLs) and can modify permissions, ownership, and auditing settings for files, directories, and registry keys.

In this instance, SetACL repairs the “Remote Procedure Call Failed” error by providing necessary permissions to a specific registry key that may be locked or incorrectly configured. By executing these commands, SetACL modifies access control entries (ACE) for that key, enabling the system to perform the required actions without permission issues.

This process ensures that the system has full access to the needed registry entries, thereby resolving the error that prevents smooth operations.

Editing the Windows registry can lead to serious issues if done incorrectly. A simple mistake may result in system instability, application errors, or even prevent Windows from starting properly. Always back up the registry before making any changes. For increased safety, create a system restore point or use reliable backup tools. If you’re uncomfortable making these changes, consider seeking professional assistance. Proceed with caution and at your own risk.

First, we’ll create a registry key if it doesn’t already exist:

  1. Press Win + R to open the Run dialog.
  2. Type regedit and press Enter to open the Registry Editor.
  3. Click Yes on the User Account Control Prompt if it appears.
  4. Navigate to the following path:
    HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage

  5. Search for the folder named winstore_cw5n1h2txyewy under Storage. If it’s missing, create it:
    • Right-click on Storage, click New, then Key.
    • Name the new key winstore_cw5n1h2txyewy.
  6. After creating the key, close the Registry Editor.

Apply Permissions Using SetACL Tool: (a Windows manipulation tool)

  1. Download the SetACL tool from the official website.
  2. Once the download is complete, extract the files and copy the appropriate version (32-bit or 64-bit) based on your operating system.
    Check your system type via Windows Settings > System > About > System Type.
  3. Copy the downloaded files to the C:\Windows\System32 folder.
  4. Press Win + S, type CMD, and select “Run as administrator” to open Command Prompt.
  5. Run the following command in the Command Prompt:
    SetACL -on "hkcu\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\winstore_cw5n1h2txyewy" -ot reg -actn ace -ace "n:S-1-15-2-2608634532-1453884237-1118350049-1925931850-670756941-1603938316-3764965493;p:full;i:so,sc;m:grant;w:dacl"

  6. After executing the command, restart your PC to apply the changes.
SetACL is a command-line tool for managing file and registry permissions in Windows. It helps resolve the “Remote Procedure Call Failed” error by adjusting permissions for a specific registry key that might be locked or misconfigured. Running these commands updates the access control settings, ensuring the system can access the registry properly to clear the error.

After restarting, try again. Hopefully, this will resolve your problem. Good luck!

ABOUT THE AUTHOR

Hamza Mohammad Anwar


Hamza Mohammad Anwar is an intermediate JavaScript web developer with a focus on developing high-performance applications using MERN technologies. His skill set includes expertise in ReactJS, MongoDB, Express NodeJS, and other related technologies. Hamza is also a Google IT Certified professional, which highlights his competence in IT support. As an avid problem-solver, he recreates errors on his computer to troubleshoot and find solutions to various technical issues.