Serilisation error when loading assembly

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an app which recieves assemblies from a network stream as byte [] and then loads them, however they are loaded as local code so they have full privlagies, so to limit this i created an app domain at runtime and used the domain.load(byte[]) method to load the assembly however it throws an exception: SerializationException, "Insufficient state to deserialize the object. More information is needed.

how can i fix this? or is there a better way to do it?
 
Spike,

How are you sending the assemblies across the network? Are you
serializing the instances of Assembly, or are you sending the actual
assembly? For some reason, I am thinking you are doing the former, which is
incorrect. You would have to send the complete assembly across the network,
not the serialized form of the object that represents an assembly in the
framework.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Spike said:
I have an app which recieves assemblies from a network stream as byte []
and then loads them, however they are loaded as local code so they have full
privlagies, so to limit this i created an app domain at runtime and used the
domain.load(byte[]) method to load the assembly however it throws an
exception: SerializationException, "Insufficient state to deserialize the
object. More information is needed."
 
im sending the actual assembly, read from a file stream in to a byte [] then sent, this normaly works fine if u ise the assembly.load method, however i get this error when i try to use the domain.load method which is required to load it with the custom app domain security level.
 
Back
Top