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 serialization

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
V&G - 29 Dec 2005 13:30 GMT
There is many topics about the subj but no one answering the
question...
Is there any way to serialize an assembly?
The case of reading from disk as stream seems like bad solution because
there are problems to process such assembly (see
http://groups.google.com/group/microsoft.public.dotnet.framework/browse_frm/thre
ad/6dff95d4ea9b6671
)
No, I'm looking for the way to serialize an assembly as we generaly
serialize other serializable objects. In case of assembly after
serialization I get only the buffer with metadata...
Here is code example:

           Byte[] buf;
           Assembly asm = Assembly.LoadFrom(path);
           using (MemoryStream ms = new MemoryStream())
           {
               BinaryFormatter format = new BinaryFormatter();
               format.Serialize(ms, asm);
               buf = ms.ToArray();
           }
Cowboy (Gregory A. Beamer) - MVP - 29 Dec 2005 14:31 GMT
Assemblies are a means of packaging classes (blueprints). If you look at the
.NET Framework BCL, you will see that there are often disparate classes and
namespaces in a single assembly, because it made sense to package them in
that way.

Serialization is a means of getting information from place to place. An
assembly is a deployable set of classes and class libraries, not information.

Can you create something to recreate all of the classes from an assembly on
another box that does not have a copy of the assembly? If this is your
question, the answer is "sure", but why not simply copy the executable. If
you need to get it from one place to another and cannot use "normal" methods
(copy and paste, for example), you can certainly stream the bits and bytes,
but that is still not "serialization".

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

> There is many topics about the subj but no one answering the
> question...
[quoted text clipped - 15 lines]
>                 buf = ms.ToArray();
>             }
V&G - 29 Dec 2005 20:22 GMT
Dear Gregory
Thank you for your ample answer.
I propose to continue the discussion about the subj here
http://groups.google.com/group/microsoft.public.dotnet.framework/browse_thread/t
hread/701533e1ac31fde2/e3e9f6f49fd0cc52?lnk=arm&hl=en#e3e9f6f49fd0cc52


I'll be happy to see you there :-)

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.