From 2dcf7745022123069d4d2d678a986f40da8bfb4d Mon Sep 17 00:00:00 2001 From: GZTime Date: Sun, 11 Sep 2022 23:30:43 +0800 Subject: [PATCH] feat: version hint --- GZCTF/CTFServer.csproj | 2 ++ GZCTF/Program.cs | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/GZCTF/CTFServer.csproj b/GZCTF/CTFServer.csproj index 7d482123b..1216b214c 100644 --- a/GZCTF/CTFServer.csproj +++ b/GZCTF/CTFServer.csproj @@ -2,6 +2,8 @@ net6.0 + 0.10.0 + GZ::CTF $(VITE_APP_GIT_NAME)-$(VITE_APP_GIT_SHA) build at $(VITE_APP_BUILD_TIMESTAMP) enable enable true diff --git a/GZCTF/Program.cs b/GZCTF/Program.cs index 940b6bf5d..13ffd8c3f 100644 --- a/GZCTF/Program.cs +++ b/GZCTF/Program.cs @@ -18,6 +18,7 @@ using Serilog.Events; using System.Text; using System.Text.Json; +using System.Reflection; var builder = WebApplication.CreateBuilder(args); @@ -313,7 +314,9 @@ await context.Posts.AddAsync(new() try { - logger.SystemLog("服务器初始化", CTFServer.TaskStatus.Pending, LogLevel.Debug); + var version = Assembly.GetExecutingAssembly() + .GetCustomAttribute()?.Description; + logger.SystemLog($"服务器初始化: {version}", CTFServer.TaskStatus.Pending, LogLevel.Debug); await app.RunAsync(); } catch (Exception exception) @@ -330,4 +333,4 @@ await context.Posts.AddAsync(new() public partial class Program { public static bool IsTesting { get; set; } -} \ No newline at end of file +}