Share via


AppDomainSetup.GetConfigurationBytes 方法

定義

傳回 SetConfigurationBytes(Byte[]) 方法設定的 XML 組態資訊,此方法會覆寫應用程式的 XML 組態資訊。

public:
 cli::array <System::Byte> ^ GetConfigurationBytes();
public byte[] GetConfigurationBytes ();
member this.GetConfigurationBytes : unit -> byte[]
Public Function GetConfigurationBytes () As Byte()

傳回

Byte[]

陣列,包含 SetConfigurationBytes(Byte[]) 方法所設定的 XML 組態資訊;如果尚未呼叫 SetConfigurationBytes(Byte[]) 方法,則為 null

備註

方法 SetConfigurationBytes 提供方法來覆寫建立新應用程式域之應用程式的組態資訊。 中的 value 組態檔資訊會覆寫應用程式的組態檔資訊。 例如,當Example.exe應用程式建立新的應用程式域時,它可以覆寫原本從 Example.exe.config 檔案取得的組態資訊。

重要

組態檔資訊的某些取用者不會使用 方法所 SetConfigurationBytes 儲存的資訊。 執行時間不會強制執行此動作。 若要確保所有組態檔資訊都會覆寫在新的應用程式域中,請使用 ConfigurationFile 屬性來指定組態檔。 方法 SetConfigurationBytes 會影響元件系結。

中的 value XML 與一般組態檔中的 XML 相同,不同之處在于它儲存為 Byte 陣列。

若要存取應用程式域的組態位元組,請使用 AppDomain.SetupInformation 屬性來取得 AppDomainSetup 應用程式域的物件,然後使用 GetConfigurationBytes 方法。

適用於