Let's say create an (executable) assembly in memory compiling a line of code. Then I want to serialize this assembly object into an array of bytes, and then save it to the database. Then later on I want to get the byte array from the database and deserialize the byte array back to the assembly object, and then call the assembly point record.
At first, I just tried to perform this serialization, like any other simple object in .net, but apparently this would not work with the assembly object. The assembly object contains the GetObjectData method, which receives the serialization data needed to restore the assembly. Therefore, I am somewhat confused by the way I put it all together for my scenario.
The answer should only show how to take the assembly object, convert it to an array of bytes, convert it back to the assembly, and then execute the write method on the deserialized assembly.
source share