Unexpected behaviour with assemblies and type resolution.


hi;

if create simple console app, in there use assembly.load(file_path) load assembly, call type.gettype(full_type_name), fails.

it fails if use load(raw_binary) too.

i can add assemblyresolve handler , pass loaded assembly there, why must i? why cant see assembly has been loaded?

also noticed when load raw binary there no version shown assembly in visual studio 'modules' window...

incidentally pass qualified (namespace, assembly, version etc) name of type gettype.

also if load assembly, use type = assembly.gettype(shortname) - works, finds type in assembly, so...if take type , pass assemblyqualifiedname property type.gettype() still fails.

this eliminates cause due me messing full name spelling etc, odd.

thx

cap'n





there no api assembly.load(file_path). did mean assembly.loadfile or assembly.loadfrom?

afaik type.gettype scans load context. therefore nothing loaded loadfile context (aka neither context), nor loadfrom context searched.

you can learn more loader contexts here: http://blogs.msdn.com/b/suzcook/archive/2003/05/29/57143.aspx

-karel



.NET Framework  >  Common Language Runtime Internals and Architecture



Comments

Popular posts from this blog

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

wcf-sql adapter bug for operation on same table

Error connecting to Azure Blob using Shared Access signature