Version Numbers

M

Mike Borrowdale

Hi,

forgive the newbie question...

I'm using VS2008 Express with c#, clickonce publishing. I can see that
my published versions have version numbers 1.0.0.1, 1.0.0.2 etc. How
can I access this version number at run time to go on a 'help about'
page? AssemblyVersion doesn't seem to have quite the same semantics,
it's either fixed (so I need to remember to update it for each new
release) or if I use the 1.0.* variant then I get 1.0.<random number>
rather than a nicely incrementing version.

Thanks in advance

Mike

--
 
M

Marc Gravell

if
(System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
{

System.Deployment.Application.ApplicationDeployment ad =
System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
version = ad.CurrentVersion.ToString();
}

Marc
 
M

Mike Borrowdale

Marc said:
if
(System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed
) {

System.Deployment.Application.ApplicationDeployment ad =
System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
version = ad.CurrentVersion.ToString();
}

Thanks Marc,

unfortunately the application is installed from CD rather then network.
Is there an alternate version for that scenario?

Mike

--
 
M

Marc Gravell

(just to tie this thread up; posted separately by OP)

Hi Marc,

ignore my last post, I finally realised that it will correctly
retrieve
the version of an installed application but nothing while debugging.
So
my help form fetches the build number while debugging and this
version
when installed. Just what the doctor ordered! Thanks.


Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top