Reputation: 221
I am trying to use the build Publish Version from Properties in my winform application.
But the version that always ends up in the application is 0.0.0.123. I found that this is the last version I had for this application back in VS2010. All new VS2012 are always 1.0.0.0
Looking at this post: C#: how to set version number of assembly I found that the AssemblyInfo.cs file hods the version information and I can change it there but why is the version from the properties tab not used?
Upvotes: 0
Views: 394
Reputation: 221
The version information is under: Application Properties-Application -Assembly Information button.
This is the basic place to change the version and is not linked to the Publish version and does not Auto-Increment. I no longer have older version to check if these options were linked before. At least I can change version without resorting to changing text.
Upvotes: 1
Reputation: 1155
In order to find the Publish Version, go to
Application Properties
-Publish
At the bottom of the screen is the publish version. You can manually change the publish version to whatever you want. Or you can have it automatically increment the revision number.
In order for the revision number to automatically increment you need to change your application from Debug
to Release
up at the top of the screen near the green start button. Or you can press the publish now button on that screen
This question here may also point you in the right direction.
If you area not needing the version to auto-increment try this here:
using System;
using System.Reflection;
[assembly:AssemblyVersion("1.1.0.0")] //Put the desired version number here.
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
this.Text = typeof(Form1).Assembly.GetName().Version.ToString();
}
}
this will display the version number inside the text of the form header.
Upvotes: 0