mscorlib 4.0.0.0

In versions previous to.NET Framework 4.0, serialization of custom user data in a security transparent code was accomplished using the method. Starting with .NET Framework 4.0, that method is marked with the attribute which prevents execution in security-transparent code. To work around this condition, implement the and add custom data as shown in the example below.

The method is called after serialization, and uses the to restore the custom data.

Enables serialization of custom exception data in security-transparent code.

- Method
  4.0.0.0
  System.Void ``

  The state object is stored in a private variable defined in the implementation of the class.

  This method is called when the instance is deserialized.

  An object that contains the state of the instance.