語言

ServerWebConfig.AddElement 方法

定義

在支援 SOAP 的 COM+ 應用程式中發佈的 COM 介面,為 Web.config 檔案加入 XML 元素。

此 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 方法會在 Web.config 檔案 <wellknown> 中加入 和 <activated> 元素,作為元素的子 <service> 節點,並帶有以下 XPath:

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

AssemblyName這些 、 TypeName、 ProgId和 WkoMode 參數都被整合進兩個新增元素的屬性值中。

AddElement 不應該直接呼叫。 相反地,請直接叫出方法。ProcessServerTlb

適用於