How to get your project's version dynamically in C#?

Ok, so I wanted to create a little Help | About page that looks like this.

MyProgram 1.0.0.5

Author: Jared Barneck

Contributors: John, Mike, Mark, Tom, Bill, Jane, Ryan, Josh

I don’t really want to have to remember to change the version in the help file with each release, so I wanted to get the version dynamically.

Turns out that you can get the version as a string with a single line of code:

String theVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

Once you have the version as a string, you can display it how you want.

16 Comments

  1. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  2. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  3. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  4. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  5. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  6. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  7. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  8. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  9. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  10. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  11. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  12. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  13. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  14. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  15. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

  16. […] the original post: How to get your project's version dynamically in C#? « Rhyous's … If you enjoyed this article please consider sharing […]

Leave a Reply