Jump to content
Xtreme .Net Talk

How to set and get the Version of my Application (.exe) [C#]


Recommended Posts

Posted

Simple enough question - how do I set and get the VERSION of my application? So that I see it when I right-click on my file->properties->version.

Unless I am blind - in the good old days it was simply in the Project->Properties->Version and we could set the Major and Minor Version, I assume C# has something similar and hopefully more sofisticated?

 

At the same time I need a way to GET that version in-code

Any help/hints would be appreciated, thanks

  • Administrators
Posted

You should be able to assign a version to yuor application through the assemblyinfo.cs file that is part of the project, or if you are not using VS then search MSDN for the AssemblyVersion attribute.

 

You can get a string representation of the version number by calling Application.ProductVersion or a more detailed bit of information by calling

System.Reflection.Assembly.GetExecutingAssembly().GetName.Version

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...