Windows phone 8.1 如何在Windows Phone通用应用程序上获取应用程序版本?

Windows phone 8.1 如何在Windows Phone通用应用程序上获取应用程序版本?,windows-phone-8.1,Windows Phone 8.1,我正在尝试使用Assembly来获取应用程序版本,但它在Universal应用程序上没有getExecutionGassembly()方法,我该怎么做 string version = "V " + Assembly.GetExecutingAssembly().FullName.Split(',')[1].Split('=')[1]; 您可以通过反射进入部件: string version = this.GetType().GetTypeInfo().Assembly.GetName().V

我正在尝试使用Assembly来获取应用程序版本,但它在Universal应用程序上没有getExecutionGassembly()方法,我该怎么做

string version = "V " + Assembly.GetExecutingAssembly().FullName.Split(',')[1].Split('=')[1];

您可以通过反射进入部件:

string version = this.GetType().GetTypeInfo().Assembly.GetName().Version.ToString(4);

(from)

我必须使用以下命令来获取Windows 10通用应用程序的版本字符串:

var version =
    Application
    .Current
    .GetType()
    .AssemblyQualifiedName
    .Split(' ')[2]
    .Split('=')[1]
    .Replace(",", "");