.NET Standard API

Last Reviewed: January 14, 2018

Article: DTS0241

Applies to: dtSearch Engine 7

Information about the dtSearch .NET Standard API (BETA)

The dtSearch Engine has a new .NET Standard API similar to the current .NET API in dtSearchNetApi4.dll, but compatible with .NET Standard 2.0, .NET Core, and Xamarin.  This API is currently in beta testing.

As with the current .NET API, the .NET Standard API relies on the dtSearch Engine native library (dtSearchEngine.dll under Windows, libdtSearchEngine.so under Linux, etc.).  Therefore, applications will need both the .NET Standard API wrapper, dtSearchNetStdApi.dll, and the native library for each platform.

API documentation is posted here.

The current dtSearch Engine for Windows beta includes the Windows and UWP versions of the .NET Standard API.  The current dtSearch Engine for Linux beta includes the Linux version of the NET Standard API.  For other platforms, please contact dtSearch.

What is .NET Standard?

.NET Standard is a common set of .NET APIs across all .NET platforms, including .NET Core, Xamarin, Mono, the .NET Framework for Windows, and UWP. For more information about .NET Standard, please see:

.NET Standard - Demystifying .NET Core and .NET Standard

Platform compatiblity matrix

Is the dtSearch .NET Standard API supported on all platforms that are compatible with .NET Standard?

The dtSearch .NET Standard API requires both the .NET Standard API wrapper, dtSearchNetStdApi.dll, and a native library for the specific environment where it runs.  Therefore, it is only supported where the dtSearch Engine native library is available.

The native library versions currently in beta testing are:

              Windows - x86 and x86_64

              Windows UWP - x86 and x86_64

              Linux - 64-bit x86_64

              macOS - 64-bit x86_64

              Android - ARM  64-bit and x86_64

              iOS - iphonesimulator and iphoneos

The following are currently only supported under Windows and Linux:

              External Language Analyzer API

              External File Parser API

              External Thesaurus API

              RAR archive support

How will the .NET Standard API be licensed?

For each platform, the .NET Standard API will be treated like other redistributable components for that platform.  When released, it will be included in the standard Linux and Windows versions of the dtSearch Engine SDK, so Windows developers will be able to use it under Windows and Linux developers will be able to use it under Linux.

The Android, macOS, and iOS versions will be licensed separately.

How does the .NET Standard API compare with the current .NET API in dtSearchNetApi4.dll?

The APIs are very similar but there are a small number of differences.  This article summarizes the changes: "Changes from dtSearchNetApi4.dll."

Another important difference is the type of DLL.  dtSearchNetApi4.dll is a mixed-mode DLL, which means that it has a 32-bit and a 64-bit version and requires certain MFC and CRT redistributables.  dtSearchNetStdApi.dll is a cross-platform library, so it does not depend on anything except .NET and is identical on all platforms except iOS.  (A separate iOS build is required due to differences in the iOS linking process.)

Why is the name of the native library used with the .NET Standard API different from the existing dtSearch Engine names?

The filename of the native library has to be the same on all platforms (except for the extension and the "lib" prefix used on Unix-based platforms), because of the way .NET Standard interfaces with native libraries.

dtSearchNetStdApi.dll uses P/Invoke to call the dtSearch Engine, and is identical on all platforms except iOS.  The same binary file runs in Windows, Linux, MacOS, and Android.

P/Invoke does not have a mechanism to vary the name of the native library called depending on the platform, so the name has to be "dtSearchEngine" on all platforms, except that the conventions for each platform for shared library names are used.  Therefore, under Windows the shared library is dtSearchEngine.dll, under Linux and Android it is libdtSearchEngine.so, and under MacOS it is libdtSearchEngine.dylib.  The iOS native library is a framework folder named dtSearchEngine_ios.framework.  All of the different dtSearchEngine native libraries are installed under the dtSearch engine\lib folder in subfolders organized by platform and CPU.