Re: [Ikvm-developers] Dynamic loading woes (again)
Brought to you by:
jfrijters
|
From: Michael K. <mi...@sa...> - 2007-02-09 09:05:09
|
Thanks for the prompt reply (brilliant software, brilliant support, shame about the documentation...) > > The issue here is that 0.32 uses a fixed (and predictable) > class loading model and no longer searches all the loaded > assemblies (which was both unpredictable and inefficient). > There are three possible work around that I can think of: > > 1) This may or may not work, depending on what the context > class loader is, but you can statically link saxon8sa.dll to > Transform.exe, that way it becomes part of the class loader > graph of Transform.exe and when the system class loader is > used (which will be the assembly class loader associated with > the application's main executable), it should be able to find > the class (because an assembly class loader searches the > corresponding assembly and all assemblies it *directly* references). > (Note that the C# compiler does not actually add an assembly > reference if you use /r but don't use any type in the > assembly, so you must add some code that actually touches a > type in the assembly.) The main reason I haven't done this is because Transform is open source and saxon8sa is commercial software. Having a static reference would stop people being able to recompile the code (I don't know whether it would lead to any run-time problems as well). But I may have to go down this route. > > 2) Write a custom class loader that knows how to load > com.saxonica.validate.SchemaAwareConfiguration and use > Thread.setContextClassLoader to set it. That sounds scary, but perhaps it's territory that I need to explore. > > 3) Use Class.forName() with an assembly qualified name. > This sounds the easiest approach, but what exactly is an "assembly qualified name"? Michael Kay http://www.saxonica.com/ |