Assembly.Load(Byte[] buffer) creates duplicity

  • Thread starter Thread starter V&G
  • Start date Start date
V

V&G

Hello all,
I'm trying to load in run-time some assembly with its referenced
assemblies.
If i calling to Assembly.LoadFrom() function all works clear.
The problems start when I use buffering.
If I read assembly's file to Byte[] array and then call to
Assembly.Load() function then each time Load() function called new
instance of assembly has been created in AppDomain (I can see this by
AppDomain.CurrentDomain.GetAssemblies())
I'm speaking about the SAME, SIGNED assembly, previously buffered to
Byte[].
Does anybody have some ideas about why CLR do it?

Thanks for all,
 
May be here an answer:
// Loaded with LoadFrom()
AppDomain.CurrentDomain.GetAssemblies()[12].ManifestModule
{MyAssembly.dll}
Assembly: {MyAssembly, Version=1.1.0.0, Culture=neutral,
PublicKeyToken=3ccfa48a3d430f5b}
FullyQualifiedName:
"C:\\Projects\\Test\\bin\\Debug\\0\\MyAssembly.dll"
MDStreamVersion: 65536
MetadataToken: 1
ModuleHandle: {System.ModuleHandle}
ModuleVersionId: {96f54c21-2866-45b4-bb54-72cdba960b88}
Name: "MyAssembly.dll"
ScopeName: "MyAssembly.dll"
// Loaded with Load()
AppDomain.CurrentDomain.GetAssemblies()[11].ManifestModule
{MyAssembly.dll}
Assembly: {MyAssembly, Version=1.1.0.0, Culture=neutral,
PublicKeyToken=3ccfa48a3d430f5b}
FullyQualifiedName: "<Unknown>"
MDStreamVersion: 65536
MetadataToken: 1
ModuleHandle: {System.ModuleHandle}
ModuleVersionId: {96f54c21-2866-45b4-bb54-72cdba960b88}
Name: "<Unknown>"
ScopeName: "MyAssembly.dll"

But why there is a difference?
How can I get an assembly name from assembly buffered in Byte[]?
 
Back
Top