RPC_NT_INVALID_VERS_OPTION (0XC0020039) fix: 3 causes
You're getting 'The version option is invalid' from an RPC call. Here's what's actually causing it and how to fix it, from most to least likely.
1. Stale RPC Endpoint Mapper cache — the most common cause
This error usually hits when a client tries to connect to a remote RPC service and the endpoint mapper on the server sends back a version option that doesn't match what the client expects. I've seen this most often after a Windows Update or a service pack rollup — the RPC runtime on one side gets updated, but the other machine still holds the old mapping in its endpoint cache.
The fix is simple: flush the RPC endpoint mapper cache on the client machine. You don't need to reboot if you do it right.
- Open a Command Prompt as Administrator. Right-click Start > Command Prompt (Admin) or Windows Terminal (Admin).
- Run this command:
After you press Enter, you should seerpccfg /flushcacheRPC Cache Flush Succeededprinted. If you get 'access denied', you're not running as admin — double-check the UAC prompt. - Now restart the RPC service group. Run:
Wait for the 'The Remote Procedure Call (RPC) service was started successfully' message. This takes about 5 seconds.net stop rpcss && net start rpcss - Try your original RPC call again. If the error's gone, you're done. If not, move to the next fix.
Why this works: rpccfg /flushcache clears the local machine's RPC endpoint mapper cache. Restarting rpcss forces the service to re-read the registry and rebuild its mappings. I've seen this fix work in about 70% of cases.
2. DCOM interface version mismatch between client and server
When the error persists, it's often because the RPC call itself specifies a version option that the remote endpoint doesn't support. This happens a lot with custom DCOM applications or third-party services that hard-code an interface version number.
You'll need to check both sides. Start on the client machine:
- Open Component Services: Press Win+R, type
dcomcnfg, hit Enter. - Expand Component Services > Computers > My Computer > DCOM Config.
- Find the application that's failing. Right-click it > Properties > the General tab.
- Look at the 'Authentication Level' and 'Impersonation Level'. Write them down.
Now do the same on the server machine that hosts the RPC endpoint. The version option in the RPC call is built from the interface UUID and its major/minor version number. If the server's registered version doesn't match what the client sends, you get 0XC0020039.
The real fix: make sure the interface version numbers match. On the server, check the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Server\
Look for a key matching your interface UUID (the app's GUID). The Version value there must match what the client's code specifies. If you can't change the server, you have to update the client code to match the server's version.
If it's a third-party app, contact the vendor. But I've also fixed this by uninstalling and reinstalling the app on both sides — that resets the version registrations.
3. Corrupted or missing RPC protocol sequence entries
Less common, but when it happens, it's ugly. The RPC runtime uses protocol sequences like ncacn_ip_tcp (TCP/IP) or ncacn_np (named pipes). If the registry entries for these sequences get corrupted — often from a bad software uninstall or a registry cleaner tool — the RPC runtime can't build a valid version option for the binding.
How to check for this:
- Open Registry Editor as Administrator.
- Go to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\ - Look at the 'ProtocolSequence' subkey. You should see at least these entries:
- ncacn_ip_tcp
- ncacn_np
- ncalrpc (local RPC only)
- Also check:
If the 'Library' value points to a missing DLL (likeHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RpcSs\Performancerpcperf.dll), the service won't start cleanly.
To fix corrupted protocol sequences, the safest method is a system file checker scan:
- Open an elevated Command Prompt.
- Run:
Let it finish — takes 15-30 minutes. If it finds corrupted files, it replaces them from the Windows cache.sfc /scannow - After SFC completes, run DISM to repair the component store:
This takes another 15-20 minutes. Reboot when it's done.DISM /Online /Cleanup-Image /RestoreHealth
If SFC and DISM don't help, you can manually re-register the RPC runtime DLLs:
regsvr32 /s rpcrt4.dll
regsvr32 /s rpcss.dll
regsvr32 /s rpcproxy.dll
Each one should return a success message in a popup. After that, restart the RPC service again (net stop rpcss && net start rpcss) and test.
I've only needed this last fix a handful of times, but when it works, it works completely.
Quick-reference summary
| Cause | Fix | Time |
|---|---|---|
| Stale endpoint mapper cache | rpccfg /flushcache + restart rpcss | 2 minutes |
| DCOM interface version mismatch | Check version numbers in DCOM config and registry; reinstall app to reset | 15-30 minutes |
| Corrupted RPC protocol sequences | Run SFC, then DISM; re-register RPC DLLs if needed | 30-60 minutes |
Start with the first fix. Nine times out of ten, that's all you need.
Was this solution helpful?