I\'m deploying now a WPF c# project and want to put the clickonce version (rather than the assembly or product version) on the screen title. I used to do it in
Try this:
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);
}