Bug #5032
closedSaxon-HE 10.5N NuGet Package cannot simply be used to replace binaries
100%
Description
We just tried to upgrade Saxon-HE .NET in one of our projects to use the official NuGet Package instead of binaries that were copied from an installation of the .NET version.
And there was basically two issues that prevented us from doing this:
- The
.nuspec
file specifies that onlysaxon-he-api-10.5.1.dll
should be referenced, but not the others. This is a problem when consuming (or implementing) various types that live insaxon-he-10.5.1.dll
; and adding a DLL reference by hand seems like a terrible hack (and not even a viable workaround, especially when NuGet packages using<PackageReference>
live in a location that cannot be easily referenced, compared to the oldpackages.config
approach where it simply lived in a predictable location inside the source tree). - As reported in #4759,
IKVM.OpenJDK.Localedata.dll
is missing from the distribution yet again (this also affects the installer, not just the NuGet package). 10.3 still had it (which can be a 50/50 between "we don't need it anymore" vs. "we forgot to include it")
For 1. a 3rd party package named Saxon-HE-norefs exists that simply removes the <references>
tag (so that NuGet references all the assemblies by default), but since it is neither official nor available for 10.5 (yet?) we'd rather not use it here (especially as we'd also like the fix from #4839 so we can replace a lot of old code with very little XSLT).
For 2., I can only guess; and erring on the side of caution I'm thinking it should still be there (since it is the same IKVM version as before)
Updated by O'Neil Delpratt almost 3 years ago
- Status changed from New to In Progress
For 1. I would be more inclined to add the saxon-he-10.5.1.dll
library to the tag than to remove all references. I hope that would work for you?
For 2. This is a bug resulting from a change to a build process. I will reopen the bug issue #4759.
Updated by Emanuel Wlaschitz almost 3 years ago
I'm afraid its not going to be that easy. We have some extension functions (for internal use) that reach into net.sf.saxon.s9api
(for example, XPathCompiler
so we can provide a "is this a valid expression to use in a <xsl:template match="...">
?" function), and those don't compile after removing the IKVM references due to:
error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'IKVM.OpenJDK.Core, Version=8.1.5717.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58'.
(that is: IKVM::java.lang.Object
, which is the base class for XPathCompiler
)
The only downside I see is the one that we have already: Visual Studio will offer IKVM types and namespaces in certain places.
But in the end, we also need the IKVM assemblies in the output directory anyways, and referencing them is the most convinient way to get this done. (Plus, I don't really know how I'd do that in a post-build step when my source folder is technically a NuGet package)
Updated by Michael Kay almost 3 years ago
Re (1), yes I think you're right. While simple applications should be able to be written using only the public stable api in the Saxon.Api
namespace, more complex applications may well need to use the "escape hatch" methods to dive down into lower-level (and potentially less stable) classes contained in the net.sf.saxon
or com.saxonica
namespaces, so the NuGet package should list these as references.
Updated by Emanuel Wlaschitz almost 3 years ago
Or, as is default for nuspec, just omit them to reference all :) (which makes changes and updates easier, since you don't have to modify it all the time)
Updated by O'Neil Delpratt almost 3 years ago
- Status changed from In Progress to Resolved
I have removed the tag from the .nuspec
file. This will be available from the next maintenance release.
I am marking this bug as resolved. For 2. I will report it in the bug issue #4759.
Updated by O'Neil Delpratt over 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.6 added
Bug fix applied in the Saxon 10.6 maintenance release
Please register to edit this issue