Version Numbering in .NET

There are lots of different version numbers in a typical .NET project. This post attempts to capture them, their differences, and their usage.

Product Version

When using ClickOnce deployment, this will give you the version number the application was published as.
Location : My Project → Publish → Publish Version
Usage:

System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion

Assembly Version

The version of the file generated by your project.
Location : My Project → Application → Assembly Information… → File version:
See: MSDN Documentation
Usage:

System.Reflection.Assembly.GetExecutingAssembly().GetName.Version

File Version

This value is what is displayed on the Version tab of the Windows file properties dialog.
Location : My Project → Application → Assembly Information… → Assembly version:
See: MSDN Documentation
Usage:

CType(System.Reflection.Assembly.GetExecutingAssembly().GetCustomAttributes( _
GetType(System.Reflection.AssemblyFileVersionAttribute), False).First, _
System.Reflection.AssemblyFileVersionAttribute).Version
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s