Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / December 2005

Tip: Looking for answers? Try searching our database.

Assembly.Load(Byte[] buffer) creates duplicity

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
V&G - 29 Dec 2005 07:23 GMT
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&G - 29 Dec 2005 08:36 GMT
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[]?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.