public static bool GetGlobalProperty(this IVsBuildPropertyStorage propertyStorage, string propertyName, bool defaultValue) { var value = propertyStorage.GetGlobalProperty(propertyName, defaultValue.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); bool result; if (!bool.TryParse(value, out result)) { return(defaultValue); } return(result); }