In my C# ClickOnce app, there is an auto-incremented Publish Version in the Project->Properties->Publish tab. I'd like to display that version in my Help->About box, but the code I'm using apparently accesses the Assembly Version, which is different. The Assembly Version can be changed manually in the Project->Propteries->Application->Assembly Information dialog. So for now, every time before I publish I've been copying the Publish Version to the Assembly version, so my dialog shows the current version of the app. There must be a better way to do this.
All I really want to do is have an accurate, auto-updated, code-accessible version number.
Here's the code I'm using to access the Assembly Version number:
public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
An alternative would be to find code that accesses the Publish Version.
Thanks in advance,
Randy