Fix Runtime Error 53

The runtime error 53 message given below is displayed when an exported DLL (Dynamic Link Library) function is called from an MTS (Microsoft Transaction Server) component that is opened as a Server Package:

Runtime error '53': File not found (DLL_File_Name.dll).

In the error message, DLL_File_Name is the name of the DLL file that is being called.

Cause Of the Error

Runtime error 53 is known to occur if the DLL file mentioned in the error message is not mentioned in the search path.

Resolution Method

When an MTS component is opened, one of the following packages can be selected:

  • Library Package: These components are opened in the creator process.
  • Server Package: These components are opened in dedicated server process.

Ideally, the DLL files must exist in the same directory as the registered MTS component. When this happens, the search order is expected to be the current folder and then the default search path. This search order is followed by an EXE application that is not instantiated in an MTS environment when it calls a COM (Component Object Model) component. This also happens if both the COM component and the DLL file exist in the same folder. Additionally, this order holds true for an MTS instantiated COM component that is configured to open as a Library object.

The runtime error 53 that we are discussing here occurs when a particular MTS component is opened as a Server Package. When this happens, the COM component is created in an isolated process space, Mts.exe. Now, the default location for the Mts.exe file is %SystemRoot%\System32. This is the reason why Mts.exe fails to find the required DLL file when it does not exist in the search path.

So, to prevent this error message and also to resolve this particular issue, you need to deploy the DLL file that is to be called on from an MTS component and opened as a Server Package in the %SystemRoot%\System32 folder.

In order to resolve this issue, perform the following tasks:

  1. Use the Windows Search feature to find out the current location of the DLL file given in the error message.
  2. When you find the file, right-click on it and then select Copy.
  3. Next, open Start menu, select Run, type %SystemRoot%\System32 in the Open box and then press Enter.
  4. In the %SystemRoot%\System32 folder that opens in Windows Explorer, right-click on the right pane, and then select Paste.

Doing this will paste a copy of the DLL file in the system32 folder and resolve the error.

Runtime errors may also occur due to the existence of invalid registry entries and malware infections. To prevent runtime errors due to registry problems, you must regularly scan and clean your registry. To do this, you may use an efficient and simple-to-use registry tool, such as RegServe. To prevent and remove malware infections, you need to perform regular full system scans using reliable antivirus and antispyware tools to detect and remove any malicious data. Spyware Cease and STOPzilla Antivirus are two excellent antimalware tools that you can use to perform these tasks.