469,623 Members | 933 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

getting the application publish version

Hi,

I use the publish feature within Vs.net 2008, and have it set to increment
on each build/publish

I want to be able to display this as my application version number, but can
not see how to access the information.

application.productversion doesn't seem to access/use the publish version.

Thanks

Jan 3 '08 #1
6 12879
On Jan 3, 4:45 pm, "Aussie Rules" <aus...@nospam.comwrote:
Hi,

I use the publish feature within Vs.net 2008, and have it set to increment
on each build/publish

I want to be able to display this as my application version number, but can
not see how to access the information.

application.productversion doesn't seem to access/use the publish version.

Thanks
Isn't there "publish" in solution explorer -your app -right click
then properties -"publish"?
Jan 3 '08 #2
yep,

i want to get that value in the runtime application, not the vs ide
"kimiraikkonen" <ki*************@gmail.comwrote in message
news:01**********************************@e25g2000 prg.googlegroups.com...
On Jan 3, 4:45 pm, "Aussie Rules" <aus...@nospam.comwrote:
>Hi,

I use the publish feature within Vs.net 2008, and have it set to
increment
on each build/publish

I want to be able to display this as my application version number, but
can
not see how to access the information.

application.productversion doesn't seem to access/use the publish
version.

Thanks

Isn't there "publish" in solution explorer -your app -right click
then properties -"publish"?
Jan 3 '08 #3
Are you using ClickOnce deployment? Is that what you mean when you say
you are using "the publish feature" ?

If so, you can only see the deployment version when you are running the
deployed version. Here's how to get it. Sorry; this is in C#. I really
miss VB...

string ourVersion = string.Empty;

//if running the deployed application, you can get the version
// from the ApplicationDeployment information. If you try
// to access this when you are running in Visual Studio, it will not work.
if (System.Deployment.Application.ApplicationDeployme nt.IsNetworkDeployed)
{
ourVersion =
ApplicationDeployment.CurrentDeployment.CurrentVer sion.ToString();
}
else
{
if (_assemblyInfo != null)
{
ourVersion = _assemblyInfo.GetName().Version.ToString();
}
}

This is probably the same thing in VB (no promises, it's been a while):

'if running the deployed application, you can get the version
' from the ApplicationDeployment information. If you try
' to access this when you are running in Visual Studio, it will not work.
Dim ourVersion as String
If System.Deployment.Application.ApplicationDeploymen t.IsNetworkDeployed
ourVersion =
ApplicationDeployment.CurrentDeployment.CurrentVer sion.ToString();
Else
If _assemblyInfo IsNot Nothing
ourVersion = _assemblyInfo.GetName().Version.ToString();
End If
End If

Good luck; hope this helps.
RobinS.
GoldMail, Inc.
--------------------------------------

"Aussie Rules" <au****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
yep,

i want to get that value in the runtime application, not the vs ide
"kimiraikkonen" <ki*************@gmail.comwrote in message
news:01**********************************@e25g2000 prg.googlegroups.com...
>On Jan 3, 4:45 pm, "Aussie Rules" <aus...@nospam.comwrote:
>>Hi,

I use the publish feature within Vs.net 2008, and have it set to
increment
on each build/publish

I want to be able to display this as my application version number, but
can
not see how to access the information.

application.productversion doesn't seem to access/use the publish
version.

Thanks

Isn't there "publish" in solution explorer -your app -right click
then properties -"publish"?
Jan 4 '08 #4
On Jan 3, 8:00 pm, "Aussie Rules" <aus...@nospam.comwrote:
yep,

i want to get that value in the runtime application, not the vs ide

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:01**********************************@e25g2000 prg.googlegroups.com...
On Jan 3, 4:45 pm, "Aussie Rules" <aus...@nospam.comwrote:
Hi,
I use the publish feature within Vs.net 2008, and have it set to
increment
on each build/publish
I want to be able to display this as my application version number, but
can
not see how to access the information.
application.productversion doesn't seem to access/use the publish
version.
Thanks
Isn't there "publish" in solution explorer -your app -right click
then properties -"publish"?
What about this?

' ' ' ' ' ' '
My.Application.Info.Version.ToString
' ' ' ' ' ' '
Jan 4 '08 #5
>
' ' ' ' ' ' '
My.Application.Info.Version.ToString
' ' ' ' ' ' '
Update: This method only gives assembly version.

Also, i don't know how to see publish version (VB.NET 2005, without
SP), but publish version is not synronized with assembly version as
well. Right/why?
Jan 4 '08 #6
See my other post. I'm assuming the OP is using ClickOnce, and you have to
pull the DeploymentVersion. And you can only see it if you are running the
deployed version, not if you are running in VS. It's kind of a pain, but not
a huge problem for us.

If you want them to be the same, you have to update the assembly version
before doing the deployment.

RobinS.
GoldMail, Inc.
---------------------------------

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:46**********************************@h11g2000 prf.googlegroups.com...
>
>>
' ' ' ' ' ' '
My.Application.Info.Version.ToString
' ' ' ' ' ' '

Update: This method only gives assembly version.

Also, i don't know how to see publish version (VB.NET 2005, without
SP), but publish version is not synronized with assembly version as
well. Right/why?
Jan 5 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Wilfried Mestdagh | last post: by
2 posts views Thread by Steven Spits | last post: by
7 posts views Thread by Mike L | last post: by
4 posts views Thread by Mike L | last post: by
6 posts views Thread by Support | last post: by
5 posts views Thread by barrysmith1966 | last post: by
1 post views Thread by igendreau | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.