Control.ProductVersion Property

Definition

Gets the version of the assembly containing the control.

C#
[System.ComponentModel.Browsable(false)]
public string ProductVersion { get; }

Property Value

The file version of the assembly containing the control.

Attributes

Examples

The following code example displays information about the application in a Label contained by a Form. This example requires that the CompanyName, ProductName and ProductVersion have been set.

C#
private void AboutDialog_Load(object sender, EventArgs e)
{
   // Display the application information in the label.
   this.labelVersionInfo.Text = 
      this.CompanyName + "  " + 
      this.ProductName + "  Version: " +
      this.ProductVersion;  
}

Remarks

The ProductVersion property is a read-only property. To change the value of this property, set the Version property value of the AssemblyVersionAttribute. The following line of C# code sets the ProductVersion property.

[assembly: AssemblyVersion("1.0.1")]

Note

It is strongly recommended that you provide the company name, product name, and product version. Providing this information enables the use of Windows Forms features such as Application.UserAppDataPath that make it easier to write applications that comply with the "Certified for Windows" program.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also