473,394 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How do I retrieve my Published version?

I am having a difficult time retrieving the Published Version as it appears in my project properties/Publish tab.

The current "Publish Version" is 1.0.0.3, but no matter what I do, I get 1.0.0.0. I'm a newb to C#. I've been searching, but the closest thing I found was a reference to "System.Deployment.Application.ApplicationDeployme nt.CurrentDeployment.CurrentVersion;" which gives me a nice error that the application is not installed.
Jun 2 '10 #1
4 14156
ThatThatGuy
449 Expert 256MB
@thomasbihn
what are you trying to achieve..
Are you trying to get the version of the assembly you're referencing..
If so then make sure you've an updated copy of the assembly in your application classpath
Jun 3 '10 #2
@ThatThatGuy
Thanks for the response ThatThatGuy. I found the solution after posting. I'm a total newbie to C# programming. But to answer your question, I believe I am getting the version of the assembly. If you right-click on the project in Solution Explorer and select Properties, a tab shows up with several side tabs. The bottom side-tab is titled "Publish". At the bottom of this section is "Publish Version", which shows Major, Minor, Build, and Revision. Automatically increment revision with each publish is checked. I wanted to show this revision in the caption of the form for the program so if someone has a problem with it, I could determine if they are working with the most recent copy. I thought Application.ProductVersion would do the trick, but it just shows 1.0.0.0. The method I found works, but it wasn't as intuitive as this seemed and doesn't actually show the version when running in debug mode. You have to build it and run the EXE to actually see the revision. The solution was as follows:

Expand|Select|Wrap|Line Numbers
  1.             if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
  2.             {
  3.  
  4.                 System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
  5.  
  6.                 this.Text = this.Text +  "    Version: " + ad.CurrentVersion.ToString();
  7.  
  8.             }
  9.  
What is an "application classpath"? I kept seeing references to "ClickOnce", but haven't seen a reference in Visual Studio 2008 to it. I assume that it is the installation method used when you publish. If this is wrong, please someone correct me.
Jun 3 '10 #3
Plater
7,872 Expert 4TB
Click once allows you to control some parts of the "install" for the publish, most imporantly that I have found is the ability to assign security privledges.
For example: I have a piece of software used throughout the company.
I publish this software to a location on a network drive. I wanted the users to be able to "run" the application from the network drive instead of installing it on their PCs. Generally this fails the default security checks(you can adjust them under admin tools->.NET configuration). With click once you can set it up so that those advanced security priveldges are requested: "Do you really wish to run this application" type prompt comes up.
This also has the added bonus of always making sure users have the most updated version everytime they run the software

EDIT: ok nm you found this part out:
Unless you run the application from the published files, you won't get the published version?
I check to see if this boolean is true first: ApplicationDeployment.IsNetworkDeployed;
Then I can access this:
ApplicationDeployment.CurrentDeployment.CurrentVer sion;
Jun 3 '10 #4
Expand|Select|Wrap|Line Numbers
  1.         Dim ourVersion As String
  2.         If My.Application.IsNetworkDeployed Then
  3.             ourVersion = Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString()
  4.         Else
  5.             ourVersion = "Testing"
  6.         End If
  7.  
  8.  
Aug 16 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: A.A. Fussy | last post by:
How would I retrieve the Windows version in a vb.net program (I want it displayed in a label)?
40
by: Matt | last post by:
I want to know what is the latest C standard version? Is it C99? There are many terms I have heard, including C98, C99, C9X. Or should we call ANSI/ISO C? Please advise. Thanks!!
1
by: Eddy Fuchs | last post by:
Hi folks, I'm searching on this issue since a couple of days: How do I programmatically retrieve the version of an installed program? Is there a possibility to retrieve it via the local MSI...
11
by: Dennis C. Drumm | last post by:
I am trying to find a way to compare the version of the currently executing assembly to the version of my latest upload so I can notify the user when a newer version is available. Is it possible...
2
by: rsphere | last post by:
my app is running just fine on my home dev box. no compilation errors at all. when i move the whole file structure to my hosted site i get the following error when opening the main page: ...
2
by: Steve Barnett | last post by:
I'm trying to put together a class that retrieves version information from my assembly and am having a problem. The code below happily retrieves the AssemblyTitle and AssemblyDescription but fails...
2
by: Vayse | last post by:
On my Help/About screen, I'd like to display 1) The version number, as it appears in the Publish screen. 2) The version number of the Report Viewer control. How would I do this? Thanks Vayse
0
by: mzmishra | last post by:
Hi, I want to write a client program to retrieve published documents from SharePoint site and store on the users machine. Can some body help me on this
0
by: rmccullough | last post by:
The test tool I use produces xml files that I am parsing and inserting into a mysql database. I then have a set of php pages that report on the test results. I wrote a C# console application that...
3
by: barcrofter | last post by:
This seems like a silly question -- How can I read the actual publish version build data??. When I use: With My.Application.Info Version.Text = "Version: " _ + Format(.Version.Major +...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.