This topic has not yet been rated - Rate this topic

AppDomain.SetData Method (String, Object, IPermission)

Assigns the specified value to the specified application domain property, with a specified permission to demand of the caller when the property is retrieved.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
public void SetData(
	string name,
	Object data,
	IPermission permission
)

Parameters

name
Type: System.String
The name of a user-defined application domain property to create or change.
data
Type: System.Object
The value of the property.
permission
Type: System.Security.IPermission
The permission to demand of the caller when the property is retrieved.
ExceptionCondition
ArgumentNullException

name is null.

InvalidOperationException

name specifies a system-defined property string and permission is not null.

Use this method to insert or modify your own user-defined entries in an internal cache of name/data pairs that describe properties of the application domain. When you insert an entry, you can specify a permission demand to enforce when the entry is retrieved.

You cannot use this method to assign a security demand to a system-defined property string.

The cache automatically contains predefined system entries that are inserted when the application domain is created. You cannot insert or modify system entries with this method. You can inspect their values with the GetData method or the equivalent AppDomainSetup properties described in the Remarks section for the GetData method.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
  • SecurityCriticalAttribute 

    requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.