SecurityException.GetObjectData Method (SerializationInfo, StreamingContext)
Assembly: mscorlib (in mscorlib.dll)
[SecurityCriticalAttribute] public override void GetObjectData( SerializationInfo info, StreamingContext context )
The SerializationInfo that holds the serialized object data about the exception being thrown.
GetObjectData sets a SerializationInfo with all the exception object data targeted for serialization. During deserialization, the exception is reconstituted from the SerializationInfo transmitted over the stream.
The following code shows the use of the SerializationInfo object.method to display the permission state contained in the
Display("Demonstrating the use of the GetObjectData method."); SerializationInfo si = new SerializationInfo( typeof(EntryPoint), new FormatterConverter()); sE.GetObjectData(si, new StreamingContext(StreamingContextStates.All)); Display("The FirstPermissionThatFailed from the " + "call to GetObjectData is: "); Display(si.GetString("FirstPermissionThatFailed"));
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Available since 1.1