static DateTime Parse(string dateStringFromLicense) { if (string.IsNullOrEmpty(dateStringFromLicense)) { throw new Exception("Invalid datestring found in xml"); } return UniversalDateParser.Parse(dateStringFromLicense.Split('T').First()); }
public static DateTime GetReleaseDate() { var attribute = (dynamic)Assembly.GetExecutingAssembly() .GetCustomAttributes(false) .FirstOrDefault(x => x.GetType().Name == "ReleaseDateAttribute"); if (attribute == null) { throw new Exception("No ReleaseDateAttribute could be found in assembly, ensure GitVersion is enabled"); } return(UniversalDateParser.Parse((string)attribute.OriginalDate)); }
public static DateTime GetReleaseDate() { var attribute = Assembly.GetExecutingAssembly() .GetCustomAttributes(false) .FirstOrDefault(x => x is ReleaseDateAttribute) as ReleaseDateAttribute; if (attribute == null) { throw new Exception("No ReleaseDateAttribute could be found in assembly, please make sure GitVersion is enabled"); } return(UniversalDateParser.Parse(attribute.OriginalDate)); }