Мое текущее решение — это жестко запрограммированная проверка официальной даты.
Код: Выделить всё
///
/// Check .NET version
/// https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core
///
protected void GetNetVersion() {
DateTime endOfLife;
this.NetVersion.Text = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription ?? Environment.Version.ToString();
//.NET 10 - End of support -> November 14, 2028
if ( Environment.Version.Major.Equals(10) && DateTime.Now > (endOfLife = DateTime.Parse("2028-11-14")) ){
this.NetVersion.Background = new SolidColorBrush(Colors.LightGoldenrodYellow);
this.NetVersion.Text = this.NetVersion.Text + "\n" + String.Format(Strings.InfoNetOutOfSupport, endOfLife.ToShortDateString());
}
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... in-c-sharp
Мобильная версия