This documentation is archived and is not being maintained.

AppDomain.SetData Method (String, Object, IPermission)

Note: This method is new in the .NET Framework version 2.0.

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
)
public void SetData (
	String name, 
	Object data, 
	IPermission permission
)
public function SetData (
	name : String, 
	data : Object, 
	permission : IPermission
)

Parameters

name

The name of a user-defined application domain property to create or change.

data

The value of the property.

permission

The permission to demand of the caller when the property is retrieved.

Exception typeCondition

ArgumentNullException

name is a null reference (Nothing in Visual Basic).

InvalidOperationException

name specifies a system-defined property string and permission is not a null reference (Nothing in Visual Basic).

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.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Show: