Fix it now
The Windows loader refused before your application ran a line of its own code. 0xC0000135 is STATUS_DLL_NOT_FOUND: a dependency could not be located. 0xC000007B is STATUS_INVALID_IMAGE_FORMAT: one was found and its machine type does not match the process. Both are usually a runtime package that is missing or only half installed.
where <name>.dll
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
- Work out the application’s architecture. Installed under
C:\Program Files (x86)means 32-bit; underC:\Program Filesmeans 64-bit. - Install both the X64 and X86 Visual C++ Redistributable from Microsoft and reboot. A 32-bit application needs the X86 package even on 64-bit Windows.
- Open Event Viewer, go to Windows Logs then Application, and read the Application Error or SideBySide entry logged at the moment of the failure. It usually names the module that failed to load.
- Repair the application itself from Settings, Apps, Installed apps, using Modify or Repair.
If the program was copied from another machine rather than installed, copy the whole folder tree and install the runtime it was built against. A copied folder loses the shared components an installer would have placed.
If the application starts, you are done. If it still will not, the next section covers the three separate checks the loader performs and which one you are failing.
Why it happens
When you launch an executable, the loader maps the image into memory and walks its import table before the entry point is reached. Every DLL named in that table has to be located on the search path, has to match the process architecture, and has to complete its own initialisation. Three checks, three separate failure codes, and knowing which one you have removes most of the guesswork.
0xC0000135 is the first check failing: STATUS_DLL_NOT_FOUND, a named DLL was not found anywhere the loader looked. Win32 error 126 is the same fault reported through a different interface – ERROR_MOD_NOT_FOUND, “The specified module could not be found” – which is why installers and service managers show 126 where the loader shows 0xC0000135.
0xC000007B is the second check: STATUS_INVALID_IMAGE_FORMAT. The DLL was found and its machine type does not match the process. A 64-bit process cannot load a 32-bit DLL and a 32-bit process cannot load a 64-bit one. This is why installing both redistributable architectures genuinely is the fix so often – the X64 package does not place the 32-bit runtime files.
0xC0000142 is the third: STATUS_DLL_INIT_FAILED. Everything resolved and matched, and a DLL’s initialisation routine returned failure. That one is rarely about a missing file at all; it usually points at the environment the process was started in – a service account, a working directory, or a desktop the process expected to have.
Only one architecture of the C++ runtime is installed
You have this one if The application sits in Program Files (x86) but Installed apps lists only the X64 redistributable, or the other way round.
- Install both the X86 and the X64 Visual C++ Redistributable from Microsoft.
- Reboot, then launch the application again.
- If the vendor documents an older runtime requirement, install that family as well. Older families are separate products and do not replace one another.
Microsoft’s current guidance is that Visual Studio 2017 and later share the same redistributable files, and that the installed Redistributable must be the same version as, or later than, the build tools used to build the application.
A DLL is missing from the application’s own folder
You have this one if 0xC0000135 or error 126 names a file that is not present next to the executable.
- Reinstall the application through its own installer rather than copying the folder. Installers place shared components a file copy leaves behind.
- If the application is deliberately portable, copy the entire directory tree including subfolders.
- Never solve this by downloading an individual DLL from a third-party site. Those files are unversioned, frequently mismatched, and a common malware vector.
A wrong copy earlier on the search path is winning
You have this one if The application works from one folder or on one machine and fails elsewhere, and a file with the same name exists in more than one location.
- Run
where <name>.dllto list every copy on the search path, in the order the loader will find them. - Check PATH for entries added by other software: press Start, type environment variables, and open the system environment editor.
- Remove or rename the stray copy, or reorder PATH so the correct directory comes first, then retest.
0xC0000142 under a service account or scheduled task
You have this one if The program starts normally when you double-click it and fails only when Task Scheduler, a service or a deployment tool launches it.
- Set the task or service working directory explicitly to the application folder rather than relying on the default.
- Confirm the account it runs as can read the application directory and the runtime directories.
- If the application expects an interactive desktop, run it as a signed-in user rather than as a service.
Full reference
The codes, and their Win32 equivalents
| Code | Name | What failed |
|---|---|---|
| 0xC0000135 | STATUS_DLL_NOT_FOUND | A dependency could not be located on the search path |
| 126 | ERROR_MOD_NOT_FOUND: The specified module could not be found | The same fault, reported through the Win32 interface |
| 127 | ERROR_PROC_NOT_FOUND: The specified procedure could not be found | The DLL was found but does not export what was asked for – a version mismatch, not an absence |
| 0xC000007B | STATUS_INVALID_IMAGE_FORMAT | A dependency was found and its machine type does not match the process |
| 0xC0000142 | STATUS_DLL_INIT_FAILED | A dependency loaded and its initialisation routine returned failure |
127 is the one people miss. If a DLL is present and the application still fails, the loader may have found the file and not the function, which happens when an older copy of a library is shadowing a newer one. where finds the copies; the version tab of each file’s properties tells you which is which.
Matching what you see to which check failed
| What you see | Where the fault is |
|---|---|
| A dialog naming a specific missing DLL | That file is absent, or the folder holding it is not on the search path |
| 0xC000007B with no file name | A bitness mismatch somewhere in the dependency chain, usually a runtime |
| Error 126 from a service or installer | The same missing-module fault as 0xC0000135, reported by a different component |
| It works for you and fails as a service | Working directory, account rights, or an expectation of an interactive desktop |
| Works on one machine, fails on another | A dependency present on the working machine is absent on the failing one |
What Microsoft publishes about the redistributables
- Visual Studio 2017 and later share the same redistributable files, and an application built by the v14 build tools available in those versions can use the latest v14 Redistributable.
- The version installed must be the same as, or later than, the version of the build tools used to create the application.
- The packages are published separately for X86, X64 and ARM64.
- The X64 Redistributable package contains both ARM64 and X64 binaries, which is how an ARM64 device gets the ARM64 files.
- Older families – the runtimes that shipped before that line – are separate products and a newer package does not stand in for them.
Commands worth knowing here
| Command | What it does |
|---|---|
where name.dll |
Lists every copy of a file on the current search path, in resolution order |
sfc /scannow |
Verifies and repairs protected system files |
DISM /Online /Cleanup-Image /RestoreHealth |
Repairs the component store that sfc draws its replacements from |
sxstrace trace -logfile:C:\temp\sxs.etl |
Captures side-by-side resolution while you reproduce the failure; stop it at the prompt |
Before you conclude the application is broken
- Check the security product’s quarantine. A DLL that was quarantined reads to the loader as missing, and the protection history will say so.
- Confirm the application and every runtime it needs are the same architecture. Mixing is the single most common cause of 0xC000007B.
- Launch from a Command Prompt rather than a shortcut. Some failures only occur under a shortcut that sets a different working directory.
- Create a new user profile and try there. A per-user PATH entry pointing at a stray runtime is invisible until you do.
- If the application is a plug-in host, disable plug-ins. A 32-bit plug-in loaded into a 64-bit host produces 0xC000007B from a file you never installed.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
0xC0000135 |
STATUS_DLL_NOT_FOUND: a DLL named in the executable’s import table could not be found on the search path | Microsoft Learn |
0xC000007B |
STATUS_INVALID_IMAGE_FORMAT: a dependency was located but its machine type does not match the process | Microsoft Learn |
0xC0000142 |
STATUS_DLL_INIT_FAILED: a dependency loaded but its initialisation routine reported failure | Microsoft Learn |
126 |
ERROR_MOD_NOT_FOUND: the specified module could not be found – the Win32 form of the same missing-module fault | Microsoft Learn |
Confirm the fix worked
- Launch the application from an ordinary user session and confirm it reaches its main window without an error dialog.
- Open Event Viewer, Windows Logs, Application, and confirm no new Application Error or SideBySide entry was written at the time of the launch.
- In Installed apps, confirm both an X86 and an X64 Visual C++ Redistributable entry are present.
- Run
where <name>.dllonce more and confirm the only copies are where you expect them. - Reboot and launch the application again, so you know the fix survived a restart rather than an in-memory state.
Questions people ask about this
Does fixing this cost anything?
No. The redistributables and every repair command here are free, and no licence is involved in a loader failure. Any site charging for a single DLL file is one to avoid.
Should I install every Visual C++ redistributable ever released?
Installing the current X86 and X64 packages is sensible on any machine that runs third-party software. Adding older families is harmless and sometimes necessary, because an application built against one of them cannot use the newer runtime.
What is the difference between 0xC0000135 and 0xC000007B?
0xC0000135 is STATUS_DLL_NOT_FOUND – the file could not be located at all. 0xC000007B is STATUS_INVALID_IMAGE_FORMAT – it was located and it is the wrong machine type, almost always 32-bit against 64-bit. The first needs the file, the second needs the right architecture of it.
Why does the error appear after a Windows update rather than after installing anything?
An update can replace a shared runtime or repair a system file an application had quietly relied on in a modified state. The dependency was already fragile and the update exposed it; reinstalling the application’s runtime is the correct response.
Can antivirus software cause 0xC0000135?
Indirectly, yes. If a scanner quarantined a DLL it judged suspicious, the loader reports it as missing. Check the security product’s quarantine or protection history before assuming the file was never installed.
