diff options
Diffstat (limited to 'Impostor-dev/src/Impostor.Server/Utils/DotnetUtils.cs')
-rw-r--r-- | Impostor-dev/src/Impostor.Server/Utils/DotnetUtils.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Impostor-dev/src/Impostor.Server/Utils/DotnetUtils.cs b/Impostor-dev/src/Impostor.Server/Utils/DotnetUtils.cs new file mode 100644 index 0000000..48a0ac0 --- /dev/null +++ b/Impostor-dev/src/Impostor.Server/Utils/DotnetUtils.cs @@ -0,0 +1,20 @@ +using System.Reflection; + +namespace Impostor.Server.Utils +{ + internal static class DotnetUtils + { + private const string DefaultUnknownBuild = "UNKNOWN"; + + public static string GetVersion() + { + var attribute = typeof(DotnetUtils).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>(); + if (attribute != null) + { + return attribute.InformationalVersion; + } + + return DefaultUnknownBuild; + } + } +} |