Export (0) Print
Expand All

AppDomainSetup.GetConfigurationBytes Method

Returns the XML configuration information set by the SetConfigurationBytes method, which overrides the application's XML configuration information.

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

public byte[] GetConfigurationBytes()

Return Value

Type: System.Byte[]
An array that contains the XML configuration information that was set by the SetConfigurationBytes method, or null if the SetConfigurationBytes method has not been called.

The SetConfigurationBytes method provides a way to override the configuration information of an application that creates a new application domain. The configuration file information in value overrides the configuration file information for the application. For example, when the Example.exe application creates a new application domain, it can override the configuration information originally obtained from Example.exe.config file.

Important noteImportant

Some consumers of configuration file information do not use the information stored by the SetConfigurationBytes method. The runtime does not enforce this. To ensure that all configuration file information is overridden in a new application domain, use the ConfigurationFile property to specify a configuration file. The SetConfigurationBytes method does affect assembly binding.

The XML in value is the same as the XML in a normal configuration file, except that it is stored as a Byte array.

To access the configuration bytes for an application domain, use the AppDomain.SetupInformation property to get the AppDomainSetup object for the application domain, then use the GetConfigurationBytes method.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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