I am trying to read an rss feed from my MVC application. The code works fine when I run it at home, however when I run my local machine at work, or on IIS 7, it fails. I suspect that this is a proxy setting problem, however I have tried modifying the config file to use the default proxy, and in any case understood that IIS went with the IE settings - and I can connect to the internet from the webserver.
The code to access the rss feed is as follows:
public static List<string> ReadDangerZoneFeed()
{
XmlReader reader = XmlReader.Create("http://rssfeedaddress.rss");
SyndicationFeed feed = SyndicationFeed.Load(reader);
reader.Close();
List<string> _DangerZones = new List<string>();
foreach (var Item in feed.Items)
{
_DangerZones.Add(Item.Title.Text);
}
return _DangerZones;
}
The error message occurs ar the XMLReader.Create line and is "Unable to connect to the remote server". I'd very much appreciate any advice,
Many thanks,
Jamie