From e260012e20d900422e60d0137eceeefcefad2afe Mon Sep 17 00:00:00 2001 From: Mate Farkas Date: Wed, 17 Apr 2024 17:51:26 +0200 Subject: [PATCH] Fix version for docker build --- ConnectionsAPI.csproj | 42 +++++++++++----------- Features/Version/Get/GetVersionEndpoint.cs | 8 ++--- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/ConnectionsAPI.csproj b/ConnectionsAPI.csproj index ee78d84..fadeca9 100644 --- a/ConnectionsAPI.csproj +++ b/ConnectionsAPI.csproj @@ -1,27 +1,25 @@  + + net8.0 + enable + enable + b560bdda-fbdf-4fb8-86ec-e8d6c743e978 + Linux + . - - net8.0 - enable - enable - b560bdda-fbdf-4fb8-86ec-e8d6c743e978 - Linux - . - + 1.0.0 + - - - - - all - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/Features/Version/Get/GetVersionEndpoint.cs b/Features/Version/Get/GetVersionEndpoint.cs index 74c33f8..8f65802 100644 --- a/Features/Version/Get/GetVersionEndpoint.cs +++ b/Features/Version/Get/GetVersionEndpoint.cs @@ -29,10 +29,10 @@ namespace ConnectionsAPI.Features.Version.Get responseBuilder.Append("by Mate Farkas; "); - responseBuilder.AppendFormat("v{0}-{1}+{2};", - GitVersionInformation.MajorMinorPatch, - GitVersionInformation.ShortSha, - GitVersionInformation.EscapedBranchName); + var currentAsm = System.Reflection.Assembly.GetExecutingAssembly(); + string asmVersion = currentAsm.GetName()?.Version?.ToString() ?? string.Empty; + + responseBuilder.AppendFormat("v{0};", asmVersion); await SendStringAsync(responseBuilder.ToString(), cancellation: ct); }