ProcessorArchitecture determination using IHostAssemblyStore

How does the CLR determine the ProcessorArchitecture to include in the Ref Identity when it calls IHostAssemblyStore.ProvideAssembly

I have a native application using the CLR Hosting api's. All of my application's assemblies are bundled in a single file, along with metadata describing the assembly identities. These identities are obtained using ICLRAssemblyIdentityManager.GetBindingIdentityFromFile.

When my application loads, IHostAssemblyStore.ProvideAssembly gets called for each of my assemblies, but the AssemblyBindInfo.lpPostPolicyIdentity seems to contain a different binding indentity than what was originally obtained and stored as metadata. As the paramater name implies, the identity passed is "Post-Policy", but that is what I am having a difficult time understanding. All of my assemblies are marked as MSIL, but the Ref Identity contains 'processorarchitecture=x86'.

If I pass on the assembly IStream anyway, I get a FileLoadException (HRESULT 0x80131040). The Fusion log is below:

LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
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 engine, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=x86.
LOG: Host store returns assembly stream with id = 113, context = 7.
LOG: Host store does not provide debug stream.
WRN: Comparing the assembly name resulted in mismatch of Processor Architecture: Ref x86, Def MSIL.
ERR: The assembly reference did not match the assembly definition found.
ERR: Unrecoverable error occurred during pre-download check (hr = 0x80131040).



Answer this question

ProcessorArchitecture determination using IHostAssemblyStore

  • Johnny KNOBLAUCH

    I found the answer - IHostAssemblyStore.ProvideAssembly is called again for the same assembly, with MSIL as the ProcessorArchitecture, when I set the HRESULT to ERROR_FILE_NOT_FOUND and set the assembly/pdb IStreams to null.
  • Tipu Delacablu

    Hope this post can help you understand how we call IHostAssemblyStore.

    http://blogs.msdn.com/junfeng/archive/2006/03/27/561775.aspx



  • ProcessorArchitecture determination using IHostAssemblyStore