IMultiThreadableTask.TaskEnvironment Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the task execution environment, which provides access to project current directory and environment variables in a thread-safe manner.
public:
property Microsoft::Build::Framework::TaskEnvironment ^ TaskEnvironment { Microsoft::Build::Framework::TaskEnvironment ^ get(); void set(Microsoft::Build::Framework::TaskEnvironment ^ value); };
public Microsoft.Build.Framework.TaskEnvironment TaskEnvironment { get; set; }
member this.TaskEnvironment : Microsoft.Build.Framework.TaskEnvironment with get, set
Public Property TaskEnvironment As TaskEnvironment
Property Value
Task environment which provides access to project current directory and environment variables.
Remarks
The MSBuild engine sets this property on behalf of the task before the task is executed, so a task should not overwrite it during execution. The one exception is constructor injection: if a task declares a public constructor that takes a TaskEnvironment, the engine invokes that constructor with the current environment, and the task is expected to assign this property from within it. This lets the task compute environment-dependent default values during construction (property initializers run before the engine could otherwise assign the property).