public SshBasedTask() { buildClient = new Lazy <IBuildClient>(() => BuildClients.Instance.Get(SessionId)); messagingService = new Lazy <MessagingService>(() => { var type = BuildClient.GetType().GetTypeInfo(); var property = type.GetDeclaredProperty("MessagingService"); return(property.GetValue(BuildClient) as MessagingService); }); macHomePath = new Lazy <string>(() => Commands.GetHomeDirectory()); }