Get Assembly Version

Below code would help you get the Assembly version.
This code also stamp the build version in a file where you want to write the build version.
The build version is nothing but versioning provided after building the Project from tfs.
so here the code:

/// This method will get the version
/// return version of version as string
private static string GetVersion()
Assembly assembly = Assembly.GetExecutingAssembly();
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
return fileVersionInfo.ProductVersion;

Md. jawed


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s