Navigation Menu

Skip to content

Commit

Permalink
Print full FrameworkDisplayName on startup if possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
belkiss committed Feb 3, 2021
1 parent eb22674 commit 4355cef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sharpmake.Application/Program.cs
Expand Up @@ -194,7 +194,7 @@ private static int Main()
}

var osplatform = Util.GetExecutingPlatform();
string framework = Util.IsRunningInMono() ? "Mono" : (Util.IsRunningDotNetCore() ? ".NET Core" : ".NET Framework");
string framework = (Util.IsRunningInMono() ? "Mono | " : "") + Util.FrameworkDisplayName();

LogWriteLine($"sharpmake {versionString} ({osplatform} | {framework})");
LogWriteLine(" arguments : {0}", CommandLine.GetProgramCommandLine());
Expand Down
2 changes: 2 additions & 0 deletions Sharpmake/Util.cs
Expand Up @@ -2498,7 +2498,9 @@ private static Platform DetectExecutingPlatform()
}

private static readonly string s_framework = Assembly.GetEntryAssembly()?.GetCustomAttribute<System.Runtime.Versioning.TargetFrameworkAttribute>()?.FrameworkName;
private static readonly string s_frameworkDisplayName = Assembly.GetEntryAssembly()?.GetCustomAttribute<System.Runtime.Versioning.TargetFrameworkAttribute>()?.FrameworkDisplayName;
private static readonly bool s_isDotNetCore = s_framework != null && !s_framework.StartsWith(".NETFramework");
public static string FrameworkDisplayName() => s_frameworkDisplayName ?? s_framework ?? "Unknown";
public static bool IsRunningDotNetCore() => s_isDotNetCore;
}
}

0 comments on commit 4355cef

Please sign in to comment.