共用方式為


ServerWebConfig.AddElement 方法

定義

將 XML 項目加入至 Web.config 檔,供啟用 SOAP 之 COM+ 應用程式中發行的 COM 介面使用。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

public:
 virtual void AddElement(System::String ^ FilePath, System::String ^ AssemblyName, System::String ^ TypeName, System::String ^ ProgId, System::String ^ WkoMode, [Runtime::InteropServices::Out] System::String ^ % Error);
public void AddElement (string FilePath, string AssemblyName, string TypeName, string ProgId, string WkoMode, out string Error);
abstract member AddElement : string * string * string * string * string * string -> unit
override this.AddElement : string * string * string * string * string * string -> unit
Public Sub AddElement (FilePath As String, AssemblyName As String, TypeName As String, ProgId As String, WkoMode As String, ByRef Error As String)

參數

FilePath
String

現有 Web.config 檔的路徑。

AssemblyName
String

包含要加入之型別的組件名稱。

TypeName
String

要加入的型別名稱。

ProgId
String

要加入之型別的程式識別項。

WkoMode
String

對應至 WellKnownObjectMode 列舉型別中成員名稱的字串常數,指出已知物件的啟動方式。

Error
String

可以用來寫入錯誤訊息的字串。

實作

備註

針對指定的型別,AddElement方法會將 和 <activated> 元素新增至 Web.config 檔案<wellknown>,做為具有下列 XPath 之元素的<service>子系:

/configuration/system.runtime.remoting/application/service

AssemblyNameTypeNameProgIdWkoMode 參數會併入兩個新增元素的屬性值中。

AddElement 不應該直接呼叫。 請改為呼叫 ProcessServerTlb 方法。

適用於