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.StringThe project file containing the task/target pair.
targetName
Type: System.StringThe name of the target.
taskName
Type: System.StringThe name of the task.
hostObject
Type: Microsoft.Build.Framework.ITaskHostThe host service.
Remarks
Overwrites any existing host service.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.