When implementing a microsoft.build.utilities.task how to i get access to the various environmental variables of the build?
问题 When implementing a microsoft.build.utilities.task how to i get access to the various environmental variables of the build? For example "TargetPath" I know i can pass it in as part of the task XML <MyTask TargetPath="$(TargetPath)" /> But i don't want to force the consumer of the task to have to do that if I can access the variable in code. http://msdn.microsoft.com/en-us/library/microsoft.build.utilities.task.aspx 回答1: I worked out how to do this public static class BuildEngineExtensions {