It is impossible to determine the error, the code curses that the part of the version line is too short or too long. But in reality, this is not the case; the file contains the text 1.0.0.0 (without spaces or anything else). The AssemblyInfo.cs attribute contains default values:

[assembly: AssemblyVersion("1.0.0.0")]

[assembly: AssemblyFileVersion("1.0.0.0")]

enter image description here

Version definition code, through the link leading to the version.txt file

  private void buttonUpdate_Click(object sender, EventArgs e) { Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version; WebClient http = new WebClient(); Version latestVersion = new Version(http.DownloadString("http://sub.domain.com/version.txt")); if (latestVersion > currentVersion) { // Доступна новая версия MessageBox.Show("Доступна новая версия"); } else { // Новых версий не обнаружено MessageBox.Show("Новой версии пока нет"); } } 
  • And what is the format of the latest version? - Tivyram
  • Must be such a NNNN - Vitokhv
  • But in fact, what does the latestVersion contain? Check out) - Tivyram
  • Tell me where to check? (I apologize for the delay, the Internet disappeared) - Vitokhv
  • this is var v = new Version("1.0.0.0"); works fine, which means you pass on something else. - tym32167

0