Serialization permissions

I'm trying to serialize some stuff for DNA. When I try, I get the following exception:

Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.3300.0  ...  ... ...


What's that mean    Do I need to grant the permission somehow


Answer this question

Serialization permissions

  • Gerard van de Ven

    Justin,

    Have you actually implemented what your thinking of   If you're thinking about an object derived from System.MarshalByRefObject (such as MemoryStream), it won't work.  It requires special permission.  :o(

  • Robert Cotran

    Right, organism code runs with Execute Only permissions, so items that specifically demand any type of permission will fail.  As Justin said, we also walk the IL code to make sure we prevent access to other items that while not necessarily considered a security threat, can be used to cheat, etc.
  • levous

    For anyone else looking into this, I'll report what I've learned.

    It appears the ecosystem enforces "Imperative Code Access Security" on our organism DLLs. There are some things we are not allowed to do. It makes sense of course, to prevent cheating. It makes sense of course, to prevent hacking of my PC by one of the terrarium critters.

    I just wish there was a list somewhere. So I'll start one. 
    The following features are prohibited in the terrarium ecosystem:
      Reflection
      Serialization
      Disk Access
      Registry Access
      
    Anyone else care to add any

  • sunbar07

    Nope, and yes, I've implemented this.  Don't worry, it'll be locked down next version.
  • William Fontinele Franca

    Ah, but that is naughty.  Delegates are protected.  Think something smaller, that might not be protected and you'll find your communications path.  What I'm thinking of you can even pass on the antenna communications and then get an unlimited *canvas* to paint your thoughts on.
  • BobHSC

    Yea, I tried to pass a delegate to my child so that I could communicate with it.  No luck.  ;o)
  • Ness22

    Oh yeah, I tried delegates too... Forgot to put that on my list.

       Static members are banned too. But I imagine we all learned that one quick!



    Now Justin wants me to pass a small canvas with my antennae...


  • Ben Chess

    You can check the FAQ, there are some items in there we talk about prohibiting.  We do this in several ways, some by turning on CAS features others by walking the IL in your assembly and denying constructs that would otherwise be considered *secure*.


  • Serialization permissions