RE: [Ikvm-developers] Dynamic loading
Brought to you by:
jfrijters
From: Jeroen F. <je...@su...> - 2006-01-24 18:17:24
|
Hi Michael, The IKVM bootstrap class loader can only find classes (by their Java names) in assemblies that have already been loaded into the current AppDomain. You can either explictly load the assembly (e.g. through Assembly.Load() or by statically referencing a type in the assembly) or you can pass the .NET assembly qualified name of the type (as returned by Type.AssemblyQualifiedName) to Class.forName(). Regards, Jeroen > -----Original Message----- > From: ikv...@li...=20 > [mailto:ikv...@li...] On=20 > Behalf Of Michael Kay > Sent: Tuesday, January 24, 2006 19:04 > To: ikv...@li... > Subject: [Ikvm-developers] Dynamic loading >=20 >=20 > I've been trying to read up on dynamic loading, but I'm=20 > confused, so it's > probably best to ask the question directly. >=20 > I've got an exe, Transform.exe, which calls classes in=20 > saxon8.dll, and under > certain conditions also wants to make calls on classes in=20 > saxon8sa.dll, > which might not be installed. All three are written in Java=20 > and compiled > statically into IL assemblies using IKVMC. >=20 > It seems that if I have a direct reference into saxon8sa.dll=20 > then I get a > failure if it's not there. I would normally think in terms of=20 > using dynamic > loading here (using Class.forName() or similar) but this,=20 > understandably > enough, isn't locating the assembly saxon8sa.dll when it is there. >=20 > Any suggestions on how I should be tackling this? I assume I=20 > should probably > be using some incantations of .NET classes to locate the assembly and > instantiate one of its classes, but how in detail? >=20 > I'm going to have other cases where I want to do dynamic loading (or > reflective instantiation, if you prefer) so I need a better=20 > understanding of > how this works. >=20 > Michael Kay > http://www.saxonica.com/=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. =20 > DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486& > dat=3D121642 > _______________________________________________ > Ikvm-developers mailing list > Ikv...@li... > https://lists.sourceforge.net/lists/listinfo/ikvm-developers >=20 |