static void RegisterServices(InitializeOpenWrap task, string currentDirectory)
        {
            Services.Services.TryRegisterService<IFileSystem>(() => LocalFileSystem.Instance);
            Services.Services.TryRegisterService<IConfigurationManager>(() => new ConfigurationManager(Services.Services.GetService<IFileSystem>().GetDirectory(InstallationPaths.ConfigurationDirectory)));
            Services.Services.TryRegisterService<IEnvironment>(() => new MSBuildEnvironment(task, currentDirectory));

            Services.Services.TryRegisterService<IPackageManager>(() => new PackageManager());
            Services.Services.RegisterService<RuntimeAssemblyResolver>(new RuntimeAssemblyResolver());
            Services.Services.RegisterService<ITaskManager>(new TaskManager());
        }
 public MSBuildEnvironment(InitializeOpenWrap initializeOpenWrap, string currentDirectory)
     : base(Path.GetDirectoryName(initializeOpenWrap.BuildEngine.ProjectFileOfTaskNode))
 {
     if (currentDirectory != null)
         CurrentDirectory = LocalFileSystem.Instance.GetDirectory(currentDirectory);
 }