![]() |
HyperX.Solver.Api 1.23.0
The HyperX Solver Application Programming Interface
|
Multi-Targeting the Solver API
Your solver criterion can be built against multiple versions of the Solver API at once.
Note: this is only useful if you need your criterion to run in multiple versions of HyperX >=2026.1
Multi-targeting allows your criterion to take advantage of new capabilities from later releases of Solver and HyperX, while maintaining backwards compatibility with earlier releases of HyperX.
Consider the following scenario:
Solver versions 1.5.0 and 2.0.0 may each have introduced properties like the following. These properties were NOT shipped in version 1.0.0.
If you want your criteria to use that signature, you have several options:
This document focuses on option (3).
To compile against all Solver versions, Criteria specify which versions they should be compiled against:
Where the exact ExtraVersions must exist in a nuget source. Nuget sources are typically configured with a nuget.config file.
The HyperX.Solver.Api nuget package includes build targets that will compile the project several times, once for the main version and once for each extra version. The output path for each extra version is computed as follows: $(OutputPath)\solver$(ExtraVersion)\. This is not user-modifiable. For example:
Where hxpkg.yaml identifies each of these main files and which APIs they correspond to.
When HyperX loads a criterion from a package, it picks the best match.
The best match is nearest version less than or equal to than the current HyperX solver runtime.
To use the new signatures in criterion code, guard them with preprocessor conditions. For example: