Re: [Ikvm-developers] Avoiding early binding
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2013-04-15 11:11:52
|
Hi Dawid,
Do the types in the intermediate assembly extend types from the missing assembly?
The only reliable way to do this is to avoid any (transitive) dependency on the missing assembly.
Regards,
Jeroen
> -----Original Message-----
> From: Dawid Weiss [mailto:daw...@gm...]
> Sent: Monday, April 15, 2013 12:40
> To: Jeroen Frijters
> Cc: ikvm-developers
> Subject: Avoiding early binding
>
> Hi Jeroen, everyone,
>
> I have some code that relies on a humongous library (~40mb) that is
> pretty much optional. I split those into two but when executed the code
> does some introspection via reflection and fails with the following if
> the large one is not available:
>
> An unhandled exception occurred: Could not load file or assembly ...
> at System.Signature.GetSignature(SignatureStruct& signature, Void*
> pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle,
> IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
> at System.Reflection.RtFieldInfo.GetRequiredCustomModifiers()
> at IKVM.Internal.AttributeHelper.GetModifiers(FieldInfo fi, Boolean
> assemblyIsPrivate)
> at IKVM.Internal.CompiledTypeWrapper.CreateFieldWrapper(FieldInfo
> field)
> at IKVM.Internal.CompiledTypeWrapper.LazyPublishFields()
> at IKVM.Internal.TypeWrapper.GetFields()
> at IKVM.NativeCode.java.lang.Class.getDeclaredFields0(Class
> thisClass, Boolean publicOnly)
> at java.lang.Class.privateGetDeclaredFields(Boolean )
> at java.lang.Class.getDeclaredFields(CallerID )
> at
> org.carrot2.util.attribute.BindableUtils.getFieldsFromHierarchy(Class
> , Class )
>
> Note this is from getDeclaredFields but, interestingly, no fields are
> declared with the classes or interfaces from the missing assembly;
> they're all all interfaces from the small assembly wrapped in
> intermediate tiny classes as in:
>
> class NewInstanceWrapper {
> public static IAmAnInterface instantiate() {
> return new ILiveInTheBigJar();
> }
> }
>
> Any hints?
>
> Dawid
|