none
Host assembly store can't provide the initial assembly RRS feed

  • Question

  • Hi,

    Is it possible for an application hosting the CLR (2.0 or higher) to provide the initial assembly that contains the AppDomainManager derivative, from the host's assembly store?

    Right now I have an app I discussed more in thread http://social.msdn.microsoft.com/Forums/en-US/clr/thread/b35fc119-0e86-4476-8f19-98c3bf6b8069 which now is able to run assemblies from the assembly store, except that it can't load Inter.dll, the C++/CLI strong-named assembly that defines the AppDomainManager, from the host's assembly store.

    The call to ICLRRuntimeHost::Start fails with error 0x80131522 (COR_E_TYPELOAD) if Inter.dll comes from the host assembly store, but it works fine if I add Inter to the non-host-store list and let the CLR load it from the app directory.

    The failure occurs after the IStream is read and released, before any more of my code is executed, afaik.

    The HostSecurityManager is not consulted, of course, since it's implemented in the very assembly that isn't loading.  I figured this might have something to do with the problem.  I tried loading Inter.dll into the GAC (even though this is not ultimately an option), to no effect.  I also tried using Caspol.exe to temporarily disable security, but this also had no effect.

    If I run it in the debugger I get this:

    Managed Debugging Assistant 'BindingFailure' has detected a problem in 's:\seng\testproj\MsclrHost\Debug\MsclrHost.exe'.
    Additional Information: The assembly with display name 'Inter' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileLoadException: Could not load file or assembly 'Inter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=blablabla' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
    File name: 'Inter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=blablabla'

    === Pre-bind state information ===
    LOG: DisplayName = Inter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=blablabla
     (Fully-specified)
    LOG: Appbase = file:///s:/seng/testproj/MsclrHost/Debug/
    LOG: Initial PrivatePath = NULL
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Configuration file s:\seng\testproj\MsclrHost\Debug\MsclrHost.config does not exist.
    LOG: No application configuration file found.
    LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Post-policy reference: Inter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=blablabla
    LOG: Fusion is hosted. Check host about this assembly.
    LOG: Assembly is not in CLR Loaded list. Asking host assembly store.
    LOG: Try host assembly store with assembly inter, version=1.0.0.0, culture=neutral, publickeytoken=blablabla, processorarchitecture=x86.
    LOG: Host store returns assembly stream with id = 10, context = 1.
    LOG: Host store does not provide debug stream.

    I figured the assembly being mixed CIL/native might have been an issue, but when I compile it as /clr:safe (which would cause me other problems but can be tolerated for tests), this makes no difference.

    Any ideas/info?

    Thanks,
    Kevin

    • Edited by Love4Brandy Wednesday, July 22, 2009 7:26 AM
    Tuesday, July 21, 2009 1:34 PM