title: how to serialize/deserialize an assembly object to and from a byte array
body: <p>Let's say a create an (executable) assembly in memory by
  compiling a code string.  Then I want to serialize this assembly
  object into a byte array and then store it in a database.  Then later
  on I want to retrieve the byte array from the database and deserialize
  the byte array back into an assembly object, then invoke the entry
  point of the assembly.</p>
  
  <p>At first I just tried to do this serialization like I would any other simple object in .net, however apparently that won't work with an assembly object.  The assembly object contains a method called GetObjectData which gets serialization data necessary to reinstantiate the assembly.  So I'm somewhat confused as to how I piece all this together for my scenario.</p>
  
  <p>The answer only needs to show how to take an assembly object, convert it into a byte array, convert that back into an assembly, then execute the entry method on the deserialized assembly.</p>