HostServices.RegisterHostObject Method

Register a host service for the given task/target pair.

MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.

Namespace:  Microsoft.Build.Execution
Assembly:  Microsoft.Build (in Microsoft.Build.dll)

Syntax

'Declaration
Public Sub RegisterHostObject ( _
    projectFile As String, _
    targetName As String, _
    taskName As String, _
    hostObject As ITaskHost _
)
public void RegisterHostObject(
    string projectFile,
    string targetName,
    string taskName,
    ITaskHost hostObject
)
public:
void RegisterHostObject(
    String^ projectFile, 
    String^ targetName, 
    String^ taskName, 
    ITaskHost^ hostObject
)
member RegisterHostObject : 
        projectFile:string * 
        targetName:string * 
        taskName:string * 
        hostObject:ITaskHost -> unit
public function RegisterHostObject(
    projectFile : String, 
    targetName : String, 
    taskName : String, 
    hostObject : ITaskHost
)

Parameters

  • projectFile
    Type: System.String

    The project file containing the task/target pair.

Remarks

Overwrites any existing host service.

.NET Framework Security

See Also

Reference

HostServices Class

Microsoft.Build.Execution Namespace