ITaskFactory2.Initialize Method (String, IDictionary<String, String>, IDictionary<String, TaskPropertyInfo>, String, IBuildEngine)
Initializes this factory for instantiating tasks with a particular inline task block and a set of UsingTask parameters. MSBuild provides an implementation of this interface, TaskHostFactory, that uses "Runtime", with values "CLR2", "CLR4", "CurrentRuntime", and "*" (Any); and "Architecture", with values "x86", "x64", "CurrentArchitecture", and "*" (Any). An implementer of ITaskFactory2 can choose to use these pre-defined Runtime and Architecture values, or can specify new values for these parameters.
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.Framework
Assembly: Microsoft.Build.Framework (in Microsoft.Build.Framework.dll)
Syntax
'Declaration
Function Initialize ( _
taskName As String, _
factoryIdentityParameters As IDictionary(Of String, String), _
parameterGroup As IDictionary(Of String, TaskPropertyInfo), _
taskBody As String, _
taskFactoryLoggingHost As IBuildEngine _
) As Boolean
bool Initialize(
string taskName,
IDictionary<string, string> factoryIdentityParameters,
IDictionary<string, TaskPropertyInfo> parameterGroup,
string taskBody,
IBuildEngine taskFactoryLoggingHost
)
bool Initialize(
String^ taskName,
IDictionary<String^, String^>^ factoryIdentityParameters,
IDictionary<String^, TaskPropertyInfo^>^ parameterGroup,
String^ taskBody,
IBuildEngine^ taskFactoryLoggingHost
)
abstract Initialize :
taskName:string *
factoryIdentityParameters:IDictionary<string, string> *
parameterGroup:IDictionary<string, TaskPropertyInfo> *
taskBody:string *
taskFactoryLoggingHost:IBuildEngine -> bool
function Initialize(
taskName : String,
factoryIdentityParameters : IDictionary<String, String>,
parameterGroup : IDictionary<String, TaskPropertyInfo>,
taskBody : String,
taskFactoryLoggingHost : IBuildEngine
) : boolean
Parameters
taskName
Type: System.StringName of the task.
factoryIdentityParameters
Type: IDictionary<String, String>Special parameters that the task factory can use to modify how it executes tasks, such as Runtime and Architecture. The key is the name of the parameter and the value is the parameter's value. This is the set of parameters that was set on the UsingTask using e.g. the UsingTask Runtime and Architecture parameters.
parameterGroup
Type: IDictionary<String, TaskPropertyInfo>The parameter group.
taskBody
Type: System.StringThe task body.
taskFactoryLoggingHost
Type: Microsoft.Build.Framework.IBuildEngineThe task factory logging host.
Return Value
Type: System.Boolean
A value indicating whether initialization was successful.
Remarks
MSBuild engine will call this to initialize the factory. This should initialize the factory enough so that the factory can be asked whether or not task names can be created by the factory. If a task factory implements ITaskFactory2, this Initialize method will be called in place of ITaskFactory.Initialize.
The taskFactoryLoggingHost will log messages in the context of the target where the task is first used.
.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.