@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:
-
if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
-
{
-
-
System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
-
-
this.Text = this.Text + " Version: " + ad.CurrentVersion.ToString();
-
-
}
-
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.