So I am using a "Updater.exe" which is reading an XML file on my webserver. The Updater checks if a new version of the program is available who transfers the new file (replacing the old one) and runs it. (The file name is gibberish as i dont want users to run it directly, it has to go trough the updater (who runs it with the help of p.StartInfo.UseShellExecute = false;)).
I have now encountered a really weird "bug" or how should i call this.
Lets say i make a new version after 1 week. I update the assembly info of the application and the XML file version aswell. Now when i run the UPDATER.exe, he does not see the new updated XML content, telling him a new version is available. As i wanted to check the file trough my web browser it was also showing the OLD content (previous version) meaning, the application is UP to DATE which is false.
After i pressed the "refresh" button in Chrome, the content i had displayed was updated and running the Updater.exe again worked fine.
I do not have any IDEA what is actually going on. What does "refreshing" the page in the browser has to do with my application?
Checking the XMLTextReader class from MSDN it says:
Represents a reader that provides fast, non-cached, forward-only access to XML data. So yeah, searching the internet telling me i should lookup for "caching" issues, makes me even more confused when i read the class description. After refreshing in the browser after such a long period of no updates, all next updates are working just fine. Seems that the "big pause" always makes this problem.
Anyway, i would love to find a solution to this. Maybe it is just ME that has this problem. But i dont want to see this problem from the users using the application. They do not have time or knowledge to "refresh" anything. It just has to work.
The XML example is here:
<?xml version="1.0" encoding = "utf-8" standalone="yes"?>
<Application>
<version>2.0.0.16</version>
<url>http://server/folder/gibberish.extension</url>
</Application>
And some code I use to read the XML.
Version newVersion = null;
string xmlUrl = "http://server/folder/file.xml";
XmlTextReader reader = null;
try
{
reader = new XmlTextReader(xmlUrl);
reader.MoveToContent();
string elementName = "";
if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "Application"))
{
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
elementName = reader.Name;
}
else
{
if ((reader.NodeType == XmlNodeType.Text) && (reader.HasValue))
{
switch (elementName)
{
case "version":
newVersion = new Version(reader.Value);
break;
case "url":
downloadUrl = reader.Value;
break;
}
}
}
}
}
}
catch (Exception ee)
{
//catch error
}
I did my best to describe the problem as detailed as i can(with my simple knowledge in english language) here. And i searched the internet with no luck. I hope this will not result in a duplicate. IF you have any other questions, feel free to ask. I will definitely give you all the information you need to solve this weird puzzle.
Best Regards, MiKE