Get Assembly version on windows phone 7

前端 未结 4 656
北恋
北恋 2021-02-13 23:56

In my c# applications I usually get the version (to show the customer) using the following code:

System.Reflection.Assembly.GetExecutingAssembly().GetName().Vers         


        
4条回答
  •  Happy的楠姐
    2021-02-14 00:52

    Try this:

        private static string GetVersionNumber()
        {
            var asm = Assembly.GetExecutingAssembly();
            var parts = asm.FullName.Split(',');
            return parts[1].Split('=')[1];
        }
    

提交回复
热议问题