How to get app version in Windows Phone?

后端 未结 11 2180
無奈伤痛
無奈伤痛 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:32

    On Phone 7 there is no clean way to get the version. The best thing to do is parse the Full Name (which is the only exposed property) for the version string:

    String appVersion = System.Reflection.Assembly.GetExecutingAssembly()
                        .FullName.Split('=')[1].Split(',')[0];
    

提交回复
热议问题