I created a method in console to read an online xml file and it worked just fine. Transfer the same code to a windows form application and I get the following error:
Exception thrown: 'System.Net.WebException' in System.Xml.dll The underlying connection was closed: An unexpected error occurred on a send.
This is the relevant code and it stops on the reader.movetocontent() line.
I'm not an advanced programmer and don't understand why it works in console but not in windows form program.
string downloadUrl = "";
Version newVersion = null;
string xmlUrl = "https://sourceforge.net/projects/bookbindingsections/files/CurrentVersion.xml";
XmlTextReader reader = null;
try
{
reader = new XmlTextReader(xmlUrl);
reader.MoveToContent();
Visual Studio Community Edition 2017 Windows 10