Sdílet prostřednictvím


HostServices.RegisterHostObject Method

Definition

Overloads

RegisterHostObject(String, String, String, ITaskHost)

Register a host object for a particular task/target pair. Overwrites any existing host object.

RegisterHostObject(String, String, String, String)

Register a remote host object for a particular task/target pair. The remote host object require registered in Running Object Table(ROT) already. Overwrites any existing host object.

It's caller's responsibly: To maintain the live cycle of the host object. Register and unregister from ROT. Ensure the host object has appropriate COM interface that can be used in task.

RegisterHostObject(String, String, String, ITaskHost)

Source:
HostServices.cs

Register a host object for a particular task/target pair. Overwrites any existing host object.

public:
 void RegisterHostObject(System::String ^ projectFile, System::String ^ targetName, System::String ^ taskName, Microsoft::Build::Framework::ITaskHost ^ hostObject);
public void RegisterHostObject (string projectFile, string targetName, string taskName, Microsoft.Build.Framework.ITaskHost hostObject);
member this.RegisterHostObject : string * string * string * Microsoft.Build.Framework.ITaskHost -> unit
Public Sub RegisterHostObject (projectFile As String, targetName As String, taskName As String, hostObject As ITaskHost)

Parameters

projectFile
String

The project file containing the task/target pair.

targetName
String

The name of the target.

taskName
String

The name of the task.

hostObject
ITaskHost

The host service.

Remarks

Overwrites any existing host service.

Applies to

RegisterHostObject(String, String, String, String)

Source:
HostServices.cs

Register a remote host object for a particular task/target pair. The remote host object require registered in Running Object Table(ROT) already. Overwrites any existing host object.

It's caller's responsibly: To maintain the live cycle of the host object. Register and unregister from ROT. Ensure the host object has appropriate COM interface that can be used in task.

public:
 void RegisterHostObject(System::String ^ projectFile, System::String ^ targetName, System::String ^ taskName, System::String ^ monikerName);
public void RegisterHostObject (string projectFile, string targetName, string taskName, string monikerName);
member this.RegisterHostObject : string * string * string * string -> unit
Public Sub RegisterHostObject (projectFile As String, targetName As String, taskName As String, monikerName As String)

Parameters

projectFile
String

project file name

targetName
String

target name

taskName
String

task name

monikerName
String

the Moniker used to register host object in ROT

Applies to