1

I've seen this question asked many dozens of times, yet I cannot find a consensus answer (or any answer that works for me).

My application is run both with and without using ClickOnce, depending on the scenario in which it is deployed. Here is the problem:

Major ...... got it.
Minor ...... got it.
Build ...... got it.
Revision ... always ZERO! <-- I want that number.

All of these things:

new Version(Application.ProductVersion).ToString()

Application.ProductVersion

Assembly.GetExecutingAssembly().GetName().Version.ToString()

FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().
Location).ProductVersion

Yield the same thing:

1.2.6.0

Which should be 1.2.6.27.

The revision is being incremented every time the application is published. So, how do I programmatically access that number? Why is this so difficult?

Thanks,

David

David.Woosley
  • 39
  • 1
  • 5

0 Answers0