how to know the Assembly/dll information of .net project .

 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”);
}
}

 

SHARE THIS

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.