locked
Equivalent version retrieval methods in WinRT?

    Question

  • This blog post shows how to get the Assembly, File, and Product versions in .NET apps (that are not WinRT):

    http://all-things-pure.blogspot.com/2009/09/assembly-version-file-version-product.html

    I can't find equivalents for FileVersionInfo and GetExecutingAssembly().  How do I get the 3 relevant versions from a WinRT app?


    -- roschler

    Sunday, March 02, 2014 9:01 PM

Answers

  • See Package, PackageId, Version in the ApplicationModel namespace.
    • Marked as answer by roschler Sunday, March 02, 2014 11:48 PM
    Sunday, March 02, 2014 10:04 PM

All replies

  • See Package, PackageId, Version in the ApplicationModel namespace.
    • Marked as answer by roschler Sunday, March 02, 2014 11:48 PM
    Sunday, March 02, 2014 10:04 PM
  • Allow me to add to Ben's correct answer, for your copy/paste pleasure:

    Windows.ApplicationModel.PackageVersion pv = Windows.ApplicationModel.Package.Current.Id.Version;
    string s = pv.Major.ToString() + "." + pv.Minor.ToString() + "." + pv.Build.ToString() + "." + pv.Revision.ToString();

    Friday, August 01, 2014 11:11 AM