Assembly.Load(Byte[] buffer) creates duplicity

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,
 
V

V&G

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[]?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top