When you get an error saying that Windows could not find a particular DLL file, it can be awfully tempting to download the file from one of the many DLL sites out there. Here’s why you shouldn’t.
What Are DLLs?
Before we get started on why you shouldn’t download Dynamic Link Library (DLL) files from the Internet, let’s first take a look at what DLL files are. A DLL file is a library that contains a set of code and data for carrying out a particular activity in Windows. Apps can then call on those DLL files when they need that activity performed. DLL files are a lot like executable (EXE) files, except that DLL files cannot be directly executed in Windows. In other words, you can’t double-click a DLL file to run it the same way you would an EXE file. Instead, DLL files are designed to be called upon by other apps. In fact, they are designed to be called upon by multiple apps at once. The “link” part of the DLL name also suggests another important aspect. Multiple DLLs can be linked together so that when one DLL is called, a number of other DLLs are also called at the same time.
Windows itself makes extensive use of DLLs, as a tour through the
C:\Windows\System32 folder can tell you. As an example of what we’re talking about, let’s consider the Windows system file “comdlg32.dll.” This file, otherwise known as the Common Dialog Box Library, contains code and data for building many of the common dialog boxes you see in Windows—dialogs for things like opening files, printing documents, and so on. The instructions in this DLL handle everything from receiving and interpreting messages meant for the dialog box to specifying how the dialog box looks on your screen. Obviously, multiple apps can call on this DLL at the same time, otherwise you wouldn’t be able to open a dialog box (like the one below) in more than one app at a time.
DLLs allow for code to be modularized and reused, which means that developers don’t have to spend time writing code from scratch to perform mundane or common functions. And though developers will create their own DLLs to install with their apps, the vast majority of DLLs called by apps are actually bundled with Windows or with extra packages, like the Microsoft .NET Framework or Microsoft C++ Redistributables. The other big advantage of modularizing code this way is that updates are easier to apply to each DLL rather than to an entire app—especially when those DLLs didn’t come from the developer of the app. For example, when Microsoft updates certain DLLs in its .NET Framework, all apps that use those DLLs can immediately take advantage of the updated security or functionality.
Downloaded DLLs May Be Outdated
So, with a little understanding of DLLs under our belts, why not download them from the Internet when one is missing from your system?
The most common problem you’ll run into with downloaded DLLs is that they are outdated. Many of the DLLs sites out there get their DLLs by just uploading them from their own—or their users’—computers. You can probably see the problem already. Most of these sites just want your traffic, and once a DLL is uploaded, they have little incentive to ensure that the file is kept up to date. Add to this that vendors don’t typically release updated DLLs to the public as individual files, and you can see that even sites who try to keep files up to date aren’t likely to be very successful.
There’s also the further problem that DLLs are usually integrated into packages. An update to one DLL in a package is often accompanies by updates to other, related DLLs in the same package, meaning that even in the unlikely event you do get an up to date DLL file, you won’t get related files that have also been updated.
Downloaded DLLs Can Be Infected
Though less common, a potentially much worse problem is that DLLs you download from sources other than the vendor sometimes can be loaded with viruses or other malware that can infect your PC. This is particularly true on sites that aren’t too careful about where they get their files. And it’s not like those sites are going to go out of their way to tell you about their risky sources. The really scary part is that if you download an infected DLL file, you risk—by the very nature of DLL files—giving that file deeper access than a regular infected file might get.
The good news here is that a good, real-time antivirus app can usually detect these infected DLL files before they’re actually saved to your system and prevent them from doing any damage. Still, you must remember that even a great antivirus program may not provide you perfect protection. If you make a habit of downloading risky files, it’s likely to catch up with you at some point. It’s best to just avoid these DLL sites.
They Probably Won’t Solve Your Problem Anyway
While it’s possible that only a single DLL file on your PC has gotten corrupted or deleted, it’s more likely that other DLLs or related app files are also corrupt or missing. The reason you’re getting an error about one particular file is that it’s the first error an app encountered before crashing and you simply aren’t being notified of the rest. This can be true no matter the cause of the problem.
Why might DLLs go missing or corrupt? It may be that another errant app or update tried to replace the file and failed, or replaced it with an out-of-date copy. It may be a fault in the installation of your main app or in a package like .NET. It may even be that you’re having another problem—like bad sectors on your hard disk—that are preventing the file from loading correctly.
How Can I Fix My DLL Error?
The only way to ensure you get a stable, up-to-date, and clean DLL is to get it through the source from which it originated. Typically, that source will be:
- Your Windows installation media. It’s unlikely you’ll be able to simply copy a DLL file from your installation media, but you do have a quick option to try before doing something as drastic as reintalling Windows. You can use the Windows Resource Protection tool (often referred to as the system file checker, or SFC), which will scan for and fix corrupt or missing system files in Windows. You should have your installation media handy when running the tool, just in case it needs to copy a file from there. (If you don’t have an installation disc, you can download one here.)
- The Microsoft .NET Framework packages. Several versions of .NET are automatically installed along with Windows, and many apps also install files from those packages as well. You can read our article about the .NET framework, which also has some advice for finding and repairing associated problems.
- Various Microsoft Visual C++ Redistributable packages. Depending on the apps you use, you may have multiple versions of the C++ Redistributable installed on your PC. It can sometimes be hard to narrow down which one is the culprit, but a good place to start is our article on C++ Redistributables, which also features several troubleshooting steps and links where you can download the most up to date versions straight from Microsoft.
- The app that the DLL came with. If the DLL was installed along with an app rather than being part of a separate package, your best bet is just to reinstall the app. Some apps allow you to perform a repair instead of a full reinstallation. Either option should work, since a repair typically looks for missing files in the installation folders.
If all that fails, you may be able to contact the app vendor and request a copy of an individual DLL file. Some companies are open to this request; some are not. If you run into a company that won’t provide individual files, they at least may be able to offer other suggestions for solving your problem.