How can I read WPF publish version number in code behind

Abdulsalam Elsharif picture Abdulsalam Elsharif · May 4, 2014 · Viewed 27.4k times · Source

I want to read and display WPF application publish version number in splash windows, In project properties in publish tab there is publish version, how can I get this and display it in WPF windows.

Thanks in advance

Answer

Sajeetharan picture Sajeetharan · May 4, 2014

Access the assembly version using Assembly.GetExecutingAssembly() and display in UI

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