// See the LICENSE file in the project root for more information.
using System.Reflection;
-using System.Diagnostics;
namespace System.Runtime.InteropServices
{
versionString = typeof(object).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
// Strip the git hash if there is one
- int plusIndex = versionString.IndexOf('+');
- if (plusIndex != -1)
- versionString = versionString.Substring(0, plusIndex);
+ if (versionString != null)
+ {
+ int plusIndex = versionString.IndexOf('+');
+ if (plusIndex != -1)
+ {
+ versionString = versionString.Substring(0, plusIndex);
+ }
+ }
}
- s_frameworkDescription = $"{FrameworkName} {versionString}";
+ s_frameworkDescription = !string.IsNullOrWhiteSpace(versionString) ? $"{FrameworkName} {versionString}" : FrameworkName;
}
return s_frameworkDescription;