Special considerations when using the AstroUtilities package |
The AstroUtities package relies on native SOFA and NOVAS libraries that are individually compiled for each supported platform and processor architecture. Your application will not work correctly if incorrect versions of the native libraries are installed.
The extent of Visual Studio compile time tooling support for including the correct native libraries in the compiled output varies by both project file format (original .NET Framework or newer SDK format) and target framework (.NET Framework or .NET 5 onward). The following sections describe how to ensure that the compiler creates functional applications that can be run from within Visual Studio.
These projects work out of the box with the native libraries appearing in a \runtimes folder in the application output folder.
PLEASE NOTE: To use the AstroUtilities package successfully it is essential that the Platform Target on the project Build tab is set to "x86", "x64" or some other explicit value and NOT to "Any CPU".
.NET Framework projects support the "Any CPU" and "Prefer 32bit" build options that can be selected on the project's "Build" tab. However, the .NET Framework build system lacks support for native libraries in packages when building for "Any CPU" and doesn't copy native libraries to the compiled application output folder. This results in "missing file" and "library not found" exceptions being thrown at run time.
Take care not to confuse the "Platform Target" on the "Build" tab with the solution level configuration target that is set in the Visual Studio toolbar. Whatever configuration is set on the toolbar, please check that the settings on the project "Build" tab are as indicated above.