469,626 Members | 1,581 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Display Publish Version

I want frmMain.text to show the current publish version.
What is the code to get the current publish version?

For example.
frmMain.text = "My Application Version: " & project.publish.version

But I don't know how to call the project.publish.version numbers.

Feb 14 '06 #1
7 45226
If you mean ClickOnce publish version:

if (System.Deployment.Application.ApplicationDeployme nt.IsNetworkDeployed) {
System.Deployment.Application.ApplicationDeploymen t ad =
System.Deployment.Application.ApplicationDeploymen t.CurrentDeployment;
version = ad.CurrentVersion;
// blah...
}

Or what do you mean?

Marc
Feb 14 '06 #2
I tried your code but errors out.

Error 3 The type or namespace name 'Application' does not exist in the
namespace 'System.Deployment' (are you missing an assembly reference?)
Here is my code.

private void frmMain_Load(object sender, System.EventArgs e)
{
System.Deployment.Application.ApplicationDeploymen t ad =
System.Deployment.Application.ApplicationDeploymen t.CurrentDeployment;

this.Text = "Dealer Sales " & ad.CurrentVersion;
}

"Marc Gravell" wrote:
If you mean ClickOnce publish version:

if (System.Deployment.Application.ApplicationDeployme nt.IsNetworkDeployed) {
System.Deployment.Application.ApplicationDeploymen t ad =
System.Deployment.Application.ApplicationDeploymen t.CurrentDeployment;
version = ad.CurrentVersion;
// blah...
}

Or what do you mean?

Marc

Feb 14 '06 #3
Hi,

Just as Marc suggested, you can get your clickonce application's public
version by
System.Deployment.Application.ApplicationDeploymen t.CurrentDeployment.Curren
tVersion property.

According to your error message, would you please tell me which the version
of Visual Studio 2005 you used? What intellisence do you get under the
System.Deployment namespace, Application or ApplicationDeployment?

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng2006 when prompted. Once you have entered the
secure code mmpng2006, you will be able to update your profile and access
the partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Feb 15 '06 #4
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: Professional

Microsoft Visual Basic 2005 77626-009-0000007-41778
Microsoft Visual Basic 2005

Microsoft Visual C# 2005 77626-009-0000007-41778
Microsoft Visual C# 2005

Microsoft Visual C++ 2005 77626-009-0000007-41778
Microsoft Visual C++ 2005

Microsoft Visual J# 2005 77626-009-0000007-41778
Microsoft Visual J# 2005

Microsoft Visual Web Developer 2005 77626-009-0000007-41778
Microsoft Visual Web Developer 2005

Crystal Reports AAC60-G0CSA4B-V7000AY
Crystal Reports for Visual Studio 2005


I get System.Deployment.Internal


""Gary Chang[MSFT]"" wrote:
Hi,

Just as Marc suggested, you can get your clickonce application's public
version by
System.Deployment.Application.ApplicationDeploymen t.CurrentDeployment.Curren
tVersion property.

According to your error message, would you please tell me which the version
of Visual Studio 2005 you used? What intellisence do you get under the
System.Deployment namespace, Application or ApplicationDeployment?

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng2006 when prompted. Once you have entered the
secure code mmpng2006, you will be able to update your profile and access
the partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Feb 16 '06 #5
Hi,
I get System.Deployment.Internal


Your .NET Framework 2.0 and Visual Studio 2005's version is OK, but there
should be another namespace under System.Deployment:

System.Deployment.Application.

I am not very clear what happened in your machine, have you referenced the
System.Deployment assembly in that winform project? I suugest you use
Object Browser(Ctrl+Alt+J) to explore the System.Deployment assembly, if
you cannot find System.Deployment.Application namespace in it, your
machine's .NET Framework 2.0 may be corruptted.
Thanks!

Best regards,

Gary Chang
Microsoft Community Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Feb 17 '06 #6
No, the System.Deployment assembly was not referenced.

Once I referenced it, it worked. Thanks.
""Gary Chang[MSFT]"" wrote:
Hi,
I get System.Deployment.Internal


Your .NET Framework 2.0 and Visual Studio 2005's version is OK, but there
should be another namespace under System.Deployment:

System.Deployment.Application.

I am not very clear what happened in your machine, have you referenced the
System.Deployment assembly in that winform project? I suugest you use
Object Browser(Ctrl+Alt+J) to explore the System.Deployment assembly, if
you cannot find System.Deployment.Application namespace in it, your
machine's .NET Framework 2.0 may be corruptted.
Thanks!

Best regards,

Gary Chang
Microsoft Community Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Feb 23 '06 #7
That's great, have a nice weekend!

Best regards,

Gary Chang
Microsoft Community Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Feb 24 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Wilfried Mestdagh | last post: by
9 posts views Thread by Rich | last post: by
2 posts views Thread by Steven Spits | last post: by
4 posts views Thread by Mike L | last post: by
5 posts views Thread by barrysmith1966 | last post: by
1 post views Thread by igendreau | last post: by
6 posts views Thread by Aussie Rules | 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.