public Static class AssemblyInfo
{
public static string BuildName;
public static string BuildVersion;
public static string BuildDate;
static GlobalInfo()
{
var assembly = Assembly.GetExecutingAssembly();
//buildName = assembly.GetName().ToString();
BuildName = "smw-service";//Hard coded intentionallly
BuildVersion = assembly.GetName().Version.ToString();
var path = Assembly.GetCallingAssembly().Location;
if (!string.IsNullOrWhiteSpace(path))
BuildDate = File.GetLastWriteTime(path).ToString("MMM dd, yyyy");
}
}
{
public static string BuildName;
public static string BuildVersion;
public static string BuildDate;
static GlobalInfo()
{
var assembly = Assembly.GetExecutingAssembly();
//buildName = assembly.GetName().ToString();
BuildName = "smw-service";//Hard coded intentionallly
BuildVersion = assembly.GetName().Version.ToString();
var path = Assembly.GetCallingAssembly().Location;
if (!string.IsNullOrWhiteSpace(path))
BuildDate = File.GetLastWriteTime(path).ToString("MMM dd, yyyy");
}
}
This post first appeared on Dot Net Tutorial For Beginners With Examples, please read the originial post: here