Export (0) Print
Expand All

AppDomain.SetData Method (String, Object)

Assigns the specified value to the specified application domain property.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

abstract SetData : 
        name:string * 
        data:Object -> unit  
override SetData : 
        name:string * 
        data:Object -> unit

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.

Implements

_AppDomain.SetData(String, Object)

ExceptionCondition
AppDomainUnloadedException

The operation is attempted on an unloaded application domain.

Use this method to insert an entry, or modify the value of an entry in an internal cache of name-data pairs that describe properties of this instance of AppDomain.

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 GetData.

You can insert or modify your own user defined name-data pairs with this method and inspect their values with the GetData method.

The following example demonstrates how to use the SetData(String, Object) method to create a new value pair. The example then uses the GetData method to retrieve the value, and displays it to the console.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.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 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft