HostServices.GetHostObject Method
Gets the host service for the given task where the task appears within a target and project with the given names.
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 Function GetHostObject ( _
projectFile As String, _
targetName As String, _
taskName As String _
) As ITaskHost
public ITaskHost GetHostObject(
string projectFile,
string targetName,
string taskName
)
public:
ITaskHost^ GetHostObject(
String^ projectFile,
String^ targetName,
String^ taskName
)
member GetHostObject :
projectFile:string *
targetName:string *
taskName:string -> ITaskHost
public function GetHostObject(
projectFile : String,
targetName : String,
taskName : String
) : ITaskHost
Parameters
projectFile
Type: System.StringThe name of the project file.
targetName
Type: System.StringThe name of the target.
taskName
Type: System.StringThe task name associated with the host service.
Return Value
Type: Microsoft.Build.Framework.ITaskHost
Returns the host service for the given task where the task appears within a target and project with the given names. If no host service exists, returns null.
.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.