Last Reviewed: April 4, 2011
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.
You may also be missing one or more of the Microsoft runtime library DLLs. Please see this artcle for information on the components required for each version of dtSearchNetApi*.dll:
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).
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).
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.