Custom CLR Assembly Load Manager RRS feed

  • Question

  • Hi,

    I'm working on a custom CLR Assembly Load Manager, and in the implementation the IHostAssemblyManager::GetNonHostStoreAssemblies method returns a custom ICLRAssemblyReferenceList.

    But, when associating this assembly load manager with the CLR, all calls to ICLRRuntimeHost::ExecuteInDefaultAppDomain fail with the same return code: 0×80131051 (FUSION_E_LOADFROM_BLOCKED)
    After reading this blog item it seems like the unmanaged hosting API doesn't allow returning a non-null value from IHostAssemblyManager::GetNonHostStoreAssemblies
    For me, this is really weird and unexpected behaviour. Why would this method be available, while it breaks the assembly load manager without any documentation about this issue.

    Is there a way to work around this limit? I really need to specify my own list of non-host-store-assemblies, in order to avoid the CLR going first to the GAC before consulting the custom assembly load manager.


    Monday, June 14, 2010 11:44 AM

All replies

  • How funny. Im currently trying to do exactly the same thing and Today i discovered exactly the same issue.

    If you just want to load some assemblys from memory there is a kind of workaround: save an assembly to disk wich contains a stub for calling Assembly.Load(byteArray). You could pass a pointer converted to hex in the string parameter and do some interop.

    But i still wonder why these hosting interfaces are so buggy. Or is this a feature? Anyway a better documentation would help.

    Wednesday, July 21, 2010 8:52 AM