Project

Profile

Help

Bug #2870

ClassNotFoundException in C#

Added by O'Neil Delpratt about 3 years ago. Updated about 3 years ago.

Status:
Won't fix
Priority:
Normal
Category:
.NET API
Sprint/Milestone:
-
Start date:
2016-08-09
Due date:
% Done:

0%

Legacy ID:
Applies to branch:
9.4
Fix Committed on Branch:
Fixed in Maintenance Release:

Description

Reported by user:

Hi,

I've encountered a problem while using the .NET version of Saxon-HE. We've got a .NET Core project which references Saxon-HE 9.4.0.7. 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:

ClassNotFoundException: cli.System.Xml.XmlDocument

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?

Thanks!

History

#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 9.4.0.7 is quite old now is it possible for you to try moving forward to a more recent maintenance release such as 9.4.0.9?

Is there anything restricting you moving forward to newer Saxon release such as Saxon-HE 9.6 or 9.7?

#2 Updated by Michael Kay about 3 years ago

If I remember rightly, Saxon 9.4 was built using an earlier version of IKVMC and it's entirely possible that that version doesn't work with .NET 4.6.

I would want to see the problem reproduced using Saxon 9.7 before we do any substantial investigation.

#3 Updated by Tom Groeneboer about 3 years ago

Hi,

I reference the nuget version: https://www.nuget.org/packages/Saxon-HE/9.7.0.7 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.

#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:

Hi,

I reference the nuget version: https://www.nuget.org/packages/Saxon-HE/9.7.0.7 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.

Hi,

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.

#7 Updated by O'Neil Delpratt about 3 years ago

Just to add, I was running your solution using Visual studio 2015. IF you are using something else the underlying problem is possibly due to the lack of support for .NET core in Saxon .Net.

Please register to edit this issue

Also available in: Atom PDF