using System;
-using System.Diagnostics;
using System.IO;
-using System.Linq;
-using System.Reflection;
using Impostor.Api.Events.Managers;
using Impostor.Api.Games;
using Impostor.Api.Games.Managers;
try
{
- // var assembly = Assembly.GetExecutingAssembly();
- // var fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);
-
- Log.Information("Starting Impostor"); // v{0}", fileVersion.ProductVersion);
+ Log.Information("Starting Impostor v{0}", DotnetUtils.GetVersion());
CreateHostBuilder(args).Build().Run();
return 0;
}
--- /dev/null
+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;
+ }
+ }
+}