This documentation is archived and is not being maintained.

SecurityPermissionAttribute.SerializationFormatter Property

Gets or sets a value indicating whether code can use a serialization formatter to serialize or deserialize an object.

[Visual Basic]
Public Property SerializationFormatter As Boolean
[C#]
public bool SerializationFormatter {get; set;}
[C++]
public: __property bool get_SerializationFormatter();
public: __property void set_SerializationFormatter(bool);
[JScript]
public function get SerializationFormatter() : Boolean;
public function set SerializationFormatter(Boolean);

Property Value

true if code can use a serialization formatter to serialize or deserialize an object; otherwise, false.

Example

[Visual Basic] 
' Set the Assertion,UnmanagedCode, ControlAppDomain, ControlDomainPolicy, ontrolEvidence, 
' ControlPolicy, ControlPrincipal, ControlThread, Execution, Flags, Infrastructure, 
' RemotingConfiguration, SerializationFormatter, and SkipVerification properties.
<SecurityPermissionAttribute(SecurityAction.Deny, Assertion:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlAppDomain:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlDomainPolicy:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlEvidence:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlPolicy:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlPrincipal:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlThread:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, Execution:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, Flags:=SecurityPermissionFlag.NoFlags), _
SecurityPermissionAttribute(SecurityAction.Deny, Infrastructure:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, RemotingConfiguration:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, SerializationFormatter:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, SkipVerification:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, UnmanagedCode:=True)> _
Public Shared Sub DenySecurityPermissions()

[C#] 
// Set the SerializationFormatter property.
    [SecurityPermissionAttribute(SecurityAction.Deny, SerializationFormatter = true)] 

[C++] 
// Set the SerializationFormatter property.
[SecurityPermissionAttribute(SecurityAction::Deny, SerializationFormatter = true)]

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

SecurityPermissionAttribute Class | SecurityPermissionAttribute Members | System.Security.Permissions Namespace

Show: