How do I get the Assembly file version info from a UWP application?


  • On a Classic Desktop application I can use the following code:

    var version = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion;
    This doesn't work when I port my project to UWP.
    Tuesday, June 21, 2016 10:51 PM


  • Hi hathor008,

    In app you can get Assembly version using two method

    The first 

    using System.Reflection;
    var d = typeof(App).GetTypeInfo().Assembly.GetName().Version;

    The second 

    If you don't want using System.Reflection namespace you can get AssemblyQualifiedName as string  and extract from this string Assembly version number

    string d = typeof(App).GetType().AssemblyQualifiedName;
    And for Universal Dll you can use First method but instead App you have to pass some type from that dll 
    • Marked as answer by hathor008 Friday, June 24, 2016 1:06 AM
    Wednesday, June 22, 2016 7:37 AM