AppDomainSetup.SetConfigurationBytes(Byte[]) 方法

定義

為應用程式定義域提供 XML 組態資訊,以取代應用程式的 XML 組態資訊。

public:
 void SetConfigurationBytes(cli::array <System::Byte> ^ value);
public void SetConfigurationBytes (byte[] value);
member this.SetConfigurationBytes : byte[] -> unit
Public Sub SetConfigurationBytes (value As Byte())

參數

value
Byte[]

包含用於應用程式定義域之 XML 組態資訊的陣列。

備註

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

重要

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

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

適用於

另請參閱