ClassNotFoundException in C#
Reported by user:
I've encountered a problem while using the .NET version of Saxon-HE. We've got a .NET Core project which references Saxon-HE 18.104.22.168. If I try to run the following code:
private static readonly Processor Processor = new Processor();
It gives me a ClassNotFoundException for cli.System.Xml.XmlDocument. This is the full error message:
at IKVM.NativeCode.ikvm.runtime.AssemblyClassLoader.LoadClass(Object classLoader, Assembly assembly, String name)
Even if I make a blanco ConsoleApplication targeting .NET 4.6.1 and reference Saxon in that project it gives me the ClassNotFoundException.
I've tried cleaning the package cache, I've tried reinstalling Java.
Did someone else encounter this problem? Is it a known issue? What can I do to fix it?
#1 Updated by O'Neil Delpratt about 3 years ago
Have you referenced all the required DLLs in your project. Can you send a repo?
Also Saxon-HE 22.214.171.124 is quite old now is it possible for you to try moving forward to a more recent maintenance release such as 126.96.36.199?
Is there anything restricting you moving forward to newer Saxon release such as Saxon-HE 9.6 or 9.7?
#3 Updated by Tom Groeneboer about 3 years ago
#4 Updated by Michael Kay about 3 years ago
The NuGet package for Saxon-HE was created by a third party, not by Saxonica. I think this problem might well be due to a problem in that package rather than anything in Saxon itself.
We currently have no idea whether Saxon works on .NET Core or can be supported in that environment. The first thing we are trying to establish is whether the IKVM runtime, which we are dependent on, is viable on .NET Core.
#5 Updated by Michael Kay about 3 years ago
- Status changed from New to Won't fix
I'm afraid the bad news is that Jeroen Frijters, the lead developer of IKVMC, tells us that .NET Core is not currently supported as a target platform by IKVMC, and that supporting it is a lot of work and won't happen any time soon. Saxon on .NET is totally dependent on IKVMC, and is therefore not supported on this platform.
#6 Updated by Community Admin about 3 years ago
Tom Groeneboer wrote:
I reference the nuget version: https://www.nuget.org/packages/Saxon-HE/188.8.131.52 and the issue still exists.
A colleague used the same application and it worked on his machine.
This is the repo: https://github.com/TomGroeneboer/SaxonHeIssue
I'm using Java version 8 update 101.
I tried your project on github and it works fine on my machine. I think the problem is specific to your machine, but I don't have any clues as to what is causing the class not found.
Please register to edit this issue