Security Permissions
-
Hello!! I am developing a control that serialize a DataSet and i want to use it in web but i have a problem, i get a System.Security.SecurityException, this is my code: --------------------------------------------------------------------------------- BinaryFormatter myFormat = new BinaryFormatter(); MemoryStream myStream = new MemoryStream(); myFormat.Serialize(myStream, myDataSet); // here is were i get the exception --------------------------------------------------------------------------------- I read in the VS documentation that i need to use a SecurityPermissionAttribute, but i don't know how to use this: [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] SecurityPermission(SecurityPermissionFlag.SerializationFormatter).Demand(); Somebody knows how can i use this to avoid that exception?? Thanks, Alberto Martinez