License search for .NET
While evaluating the Saxon .NET-API we're faced a probably not so wishful behavior when Saxon search for its license.
If the Saxon Software Installer (PE/EE) is once installed on a machine, it registers the Saxon API in GAC which might be a good idea. In such case, when calling "new Processor(true)" the implicit license search will search only in the GAC-folder, but never in the path, where the entry assembly or any intermediate assembly is located. As a result, the license will not be found, even it's placed in the same folder as the linked executable file (.EXE).
When executing the same code on a machine where the Saxon Software installer was never run, all works fine: The license is found imediately.
In our situation we use now "Process.SetProperty(Feature.LICENSE_FILE_LOCATION, "path")" to declare an explicit path to the license file. Works fine, but costs up to 80% additional processor initialization time. However we also tried to use the constructor with the configuration file: this costs even more time.
We tried also to set the environment variable "SAXON_HOME" to the executable path at runtime, before Processor construction, but this had no impact at all, the license was not found, if the libraries were in GAC and the license file in the executable path (may be, the environment variable was read by Saxon prior to Processor construction due some internal static stuff?).
F.ex. on a recent Windows 10 surface notebook:
- Processor construction and Saxon not in GAC, license in same place as executable => about 450 ms
- Processor construction and Saxon in GAC, license pointed through ".SetProperty" => 800 ms
- Processor construction and Saxon in GAC, license pointed through configuration file (absolute minimalistic configuration) => 900 ms
Our software is juggling with isolated application domains, therefore Processor instances are not recycled but must be recreated many times. That means, we loose the mentioned time in every recreation phase.
However, as a suggestion I would propose to adjust the license search behavior in that way, that ...
- The license file is also searched in along the assembly reference chain up to executable file (so it won't stuck at GAC path)
- The license file can be provided as a stream through Processor construction (same as configuration)
And one more related thing we encountered: When uninstalling the Saxon software by control panel, the assemblies in GAC are not removed ...
Thank you for reading our report and taking it for consideration for future releases.
Please register to reply