How to get app version in Windows Phone?

后端 未结 11 2158
無奈伤痛
無奈伤痛 2020-12-01 13:55

In C# one can use System.Version.Assembly to get the version of a running app. However this doesn\'t appear to exist in Silverlight for Windows Phone. Is there an alternat

11条回答
  •  被撕碎了的回忆
    2020-12-01 14:54

    You can use the GetExecutingAssembly method and the AssemblyName class to find this information.


      var nameHelper = new AssemblyName(Assembly.GetExecutingAssembly().FullName);
    
      var version = nameHelper.Version;
      var full = nameHelper.FullName;
      var name = nameHelper.Name;
    

提交回复
热议问题