diff --git a/TaxBaik.Web/Pages/Shared/_Footer.cshtml b/TaxBaik.Web/Pages/Shared/_Footer.cshtml index d35cad6..af0c97b 100644 --- a/TaxBaik.Web/Pages/Shared/_Footer.cshtml +++ b/TaxBaik.Web/Pages/Shared/_Footer.cshtml @@ -1,5 +1,20 @@ @{ - var versionInfo = ViewContext.HttpContext.RequestServices.GetService(typeof(VersionInfo)) as VersionInfo; + string versionText = "unknown"; + try + { + var versionPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "version.txt"); + if (System.IO.File.Exists(versionPath)) + { + var lines = System.IO.File.ReadAllLines(versionPath); + var versionLine = lines.FirstOrDefault(l => l.StartsWith("Version:")); + var builtLine = lines.FirstOrDefault(l => l.StartsWith("Built:")); + if (versionLine != null && builtLine != null) + { + versionText = $"{versionLine.Replace("Version:", "").Trim()} | {builtLine.Replace("Built:", "").Trim()}"; + } + } + } + catch { } }