Last Reviewed: August 26, 2009

Article: DTS0197

Applies to: dtSearch Engine 6.40 and later

One of these errors occurs running an application that uses the dtSearch Engine's .NET API:

This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

 

Activation context generation failed for [application component]

 

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in [program name]

Additional information: File or assembly name dtSearchNetApi, or one of its dependencies, was not found

 

Unhandled Exception: 'System.TypeInitializationException':  The type initializer for 'ApiInitializer' throw an exception. ---> System.IO.FileNotFoundException: dten600.dll.

 

Resolution:  (a) Check for missing MFC or CRT components

You may also be missing one or more of the Microsoft runtime library DLLs.  For dtSearchNetApi.dll, msvcr71.dll is required.

For dtSearchNetApi2.dll the MFC 8.0 and CRT 8.0 merge modules are required.  To install these components, you can use the Microsoft installers linked below.  

Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update (July 28, 2009)
http://www.microsoft.com/downloads/details.aspx?familyid=766A6AF7-EC73-40FF-B072-9112BAB119C2&displaylang=en

There have been several versions of the Microsoft installers since the release of Visual C++ 2005.  Only versions dated July 28, 2009 or later should be used.  Earlier versions include components with an ATL security vulnerability.   For more information, please see dtSearch Information Relating to Microsoft Security Bulletin MS09-035.

dtSearchNetApi2.dll versions 7.63 and later require this version of the MFC and CRT components, because they were built with Visual C++ 2005 after the ATL Security Update in July 2009. 

Resolution:  (b) Add dten600.dll to a folder on the system PATH, or register it using regsvr32 (32-bit applications)

dtSearchNetApi2.dll (or dtSearchNetApi.dll in .NET 1.1) depends on dten600.dll.   When you add a reference to dtSearchNetApi2.dll in your project, Visual Studio may copy dtSearchNetApi2.dll to the project folder. However, dten600.dll is not copied, and because dtSearchNetApi2.dll is not in the same folder as dten600.dll, Windows may not be able to resolve the dependency on dten600.dll.

To fix the problem, do one of the following:

(1) Register dten600.dll using this command (see note below):

regsvr32 dten600.dll

dtSearchNetApi2.dll does not use the COM type library that regsvr32 registers, but it uses the registry entry created by regsvr32 to determine where dten600.dll is located, which provides a simple way to ensure that dten600.dll can always be located.

(2) Copy dten600.dll to the folder where dtSearchNetAPI.dll is located.  Note: In ASP.NET applications, this will not work because ASP.NET copies the application to a temporary folder to execute, and the dten600.dll file gets left behind in this process, so copying dten600.dll into the BIN folder for your application does not solve the problem.  For applications other than ASP.NET applications, this is the recommended solution because it ensures that your application will run with the exact dten600.dll version that you include with the application.

(3) Copy dten600.dll to a folder that is listed on the system PATH, such as the c:\windows folder.

(4) Add the folder where dten600.dll is located to the system PATH (see "How to change the system PATH" below for instructions).

Resolution:  (c) Add dtengine.dll to a folder on the system PATH, or register it using regsvr32 (64-bit applications)

The 64-bit version of dtSearchNetApi2.dll depends on dtengine64.dll.   When you add a reference to dtSearchNetApi2.dll in your project, Visual Studio may copy dtSearchNetApi2.dll to the project folder. However, dtengine64.dll is not copied, and because dtSearchNetApi2.dll is not in the same folder as dtengine64.dll, Windows may not be able to resolve the dependency on dtengine64.dll.

To fix the problem, do one of the following:

(1) Register dtengine64.dll using this command (see note below):

regsvr32 dtengine64.dll

dtSearchNetApi2.dll does not use the COM type library that regsvr32 registers, but it uses the registry entry created by regsvr32 to determine where dtengine64.dll is located, which provides a simple way to ensure that dtengine64.dll can always be located.

(2) Copy dtengine64.dll to the folder where dtSearchNetAPI2.dll is located.  Note: In ASP.NET applications, this will not work because ASP.NET copies the application to a temporary folder to execute, and the dtengine64.dll file gets left behind in this process, so copying dtengine64.dll into the BIN folder for your application does not solve the problem.  For applications other than ASP.NET applications, this is the recommended solution because it ensures that your application will run with the exact dten600.dll version that you include with the application.

(3) Copy dtengine64.dll to a folder that is listed on the system PATH, such as the c:\windows folder.

(4) Add the folder where dtengine64.dll is located to the system PATH (see "How to change the system PATH" below for instructions).

 

How to change the system PATH

The PATH is a list of folder names that Windows uses to locate executables.   The following steps will add the dtSearch program folder to the system PATH.

(1) Click Start > Settings > Control Panel

(2) Click System

(3) Click the Advanced tab.

(4) Click the Environment Variables button

(5) Under System variables, locate the "Path" variable and click on it

(6) Click the Edit button

(7) Add this to the end of the current value (assuming you installed dtSearch to the default location):

;c:\Program Files\dtSearch Developer\bin

The semicolon is needed to separate the dtSearch directory name from the last item listed in the existing PATH.  

A reboot may be necessary for some programs to recognize the change to the PATH.