Bonjour, comment puis je recuperer la version depuis clickonce ?
j'ai mis :il me donne :Code:lblVersion.Text = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
Code:{"Application is not installed."}
Version imprimable
Bonjour, comment puis je recuperer la version depuis clickonce ?
j'ai mis :il me donne :Code:lblVersion.Text = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
Code:{"Application is not installed."}
Solution :
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 lblVersion.Text = "Version "+GetPublishedVersion().ToString(); public static Version GetPublishedVersion() { XmlDocument xmlDoc = new XmlDocument(); Assembly asmCurrent = System.Reflection.Assembly.GetExecutingAssembly(); string executePath = new Uri(asmCurrent.GetName().CodeBase).LocalPath; xmlDoc.Load(executePath + ".manifest"); string retval = string.Empty; if (xmlDoc.HasChildNodes) { retval = xmlDoc.ChildNodes[1].ChildNodes[0].Attributes.GetNamedItem("version").Value.ToString(); } return new Version(retval); }