You may receive the "Runtime error '53': file not found" error message when exported DLL functions are called from an MTS component

Retired KB Content Disclaimer

This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.


When you call an exported Dynamic Link Library (DLL) function from a Microsoft Transaction Server (MTS) component that is opened as a Server Package, you may receive the following error message:
Runtime error '53': File not found (yourfile.dll).
The placeholder yourfile.dll is the name of your DLL.


This problem occurs when your DLL is not in the search path.


To resolve this problem, move your DLL to the %SystemRoot%\System32 folder.

More Information

Typically, you want to put your DLL in the same directory as the registered MTS component. You can then expect the search order to first examine the current folder and then to examine the default search path. This is true for an EXE application that calls a Component Object Model (COM) component that is not instantiated in an MTS environment. This is true as long as the component and your DLL are in the same folder. This also works for a component that is instantiated in an MTS environment and configured to be opened as a Library Package.

The problem that this article discusses occurs when an MTS component is opened as a Server Package. In this case, the component is created in the Mtx.exe isolated process space. By default, Mtx.exe is located in the %SystemRoot%\System32. Therefore, Mtx.exe cannot find your DLL unless your DLL is in the search path.

When you create a DLL that is called from an MTS component that is opened as a Server Package, you are supposed to deploy your DLL in the %SystemRoot%\System32 folder. You want to do this so that this problem does not occur.

Note When you open an MTS component, you have the following packages to select between:
  • Library Package
    Components are opened in the creators process.
  • Server Package
    Components are opened in a dedicated server process.

Article ID: 240416 - Last Review: Oct 11, 2005 - Revision: 1