From db25fdeee15952caea200691b2b421e81b9c230a Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sat, 1 Feb 2025 13:51:28 +0800 Subject: [PATCH] Revert "Remove using System.Reflection" This reverts commit 732c3eee8bd24a93f3d8835de278c97f3d9e3f74. --- v2rayN/ServiceLib/Common/Utils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2rayN/ServiceLib/Common/Utils.cs b/v2rayN/ServiceLib/Common/Utils.cs index ede91cbe..f4b60f3c 100644 --- a/v2rayN/ServiceLib/Common/Utils.cs +++ b/v2rayN/ServiceLib/Common/Utils.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; +using System.Reflection; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Principal; @@ -501,8 +502,7 @@ namespace ServiceLib.Common { try { - var info = FileVersionInfo.GetVersionInfo(GetExePath()); - return $"{info.FileMajorPart}.{info.FileMinorPart}.{info.FileBuildPart}"; + return Assembly.GetExecutingAssembly()?.GetName()?.Version?.ToString(3) ?? "0.0"; } catch (Exception ex) {