ikvm icon indicating copy to clipboard operation
ikvm copied to clipboard

Where is addBootClassPathAssemby of ikvm.runtime.Startup now?

Open martin-honnen opened this issue 1 year ago • 2 comments

https://sourceforge.net/p/ikvm/wiki/ClassLoader/#bootclasspathassemby documents e.g. ikvm.runtime.Startup.addBootClassPathAssemby(Assembly.Load("YourDll")); and I think both the original 8.1 and the current 8.2.1 support that (https://github.com/ikvm-revived/ikvm/blob/8.2.1/src/IKVM.Runtime/Java/Externs/ikvm/runtime/Startup.cs).

In the current development branch I don't find Startup. Is the method addBootClassPathAssemby available somewhere else?

I has helped me in the past to explicitly load some assembly.

martin-honnen avatar Sep 27 '22 21:09 martin-honnen

Hmm. It isn't. Got lost in the shuffle of rewriting the launcher code.

Wonder what the best place for it to actually be is. Putting it on Startup seems a bit odd. I'd move it to the new Launcher, but that seems odd too.

To those thinking about long term design: having to do this is kinda dumb. The classloader hierarchy should terminate in a loader that resolves types from every available assembly in the .NET application. Basically, at the top, it should delegate to .NET to resolve .NET assemblies. AppDomain for Framework, DependencyContext for Core.

wasabii avatar Sep 27 '22 22:09 wasabii

Oh, I will point something out.

If you use the AppDomainAssemblyClassLoader on your DLL, it will do what I just described. I altered that a few releases ago to resolve from the AppDomain or current AssemblyLoadContext.

IKVM.Maven.Sdk uses it by default so everything can see everything else.

wasabii avatar Sep 27 '22 22:09 wasabii

Added Startup.addBootClassPathAssembly back. But only the one that is correctly spelled.

wasabii avatar Oct 03 '22 19:10 wasabii

fixed by 2ceec0eed6923b879726c973fab2453210657e64

wasabii avatar Oct 03 '22 19:10 wasabii