To use NMath types in your application, add a reference to NMath.dll. The search order is the same as for the common language runtime: first the GAC is searched, then the directory containing the currently executing assembly, and so on. (See Section 1.5 for more information.)
We recommend that you build your application using either the x86 or x64 build configuration (depending on which NuGet package is being used), so you can deploy to either 32-bit or 64-bit environments. Also note that if you are building for .NET 4.5 or higher and targeting x64, ensure that the Prefer 32-bit flag is unchecked under Build | Platform target in your project properties.
To deploy your application, either
● Install the NMath .NET assemblies in the GAC (NMath.dll)—the appropriate native DLLs will also be placed in the GAC since they are linked resources; or
● Place the main .NET assembly (NMath.dll) in the same directory as your application. Use the NativeLocation property, or the equivalent environment variable or app config setting, to specify the location of the native assemblies (Section 1.5). The specified location should contain /x86 and /x64 subdirectories. The appropriate architecture-specific natives are loaded at runtime.
If your application fails to locate the native assemblies at runtime, enable configuration logging (Section 1.5), which will provide information on the search path.
A valid license key must accompany your deployed NMath code. The key can be specified using an environment variable, app config setting, or compiled in your code for greatest security. (See Section 1.5 for more information.)
NMath has a dependency on the Microsoft Visual C++ 2017 runtime. The NMath installer places the C++ runtime on your development machine, if necessary. However, when you deploy your application, you may need to add it to your installer.
There are two ways to do this:
● Add the Microsoft Visual C++ 2017 merge module to your installer. It can be found here:
x86: C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC120_CRT_x86.msm
x64: C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC120_CRT_x64.msm
or on the web.
● Use the Microsoft Visual C++ 2017 redistributable:
Note: Visual C++ 2015, 2017 and 2019 all share the same redistributable files.