使用C#4.0 SyndicationFeed读取RSS(0.91)内容时出错

时间:2013-11-13 17:36:01

标签: c# .net xml rss

我在阅读此Feed时遇到错误:http://www.valor.com.br/rss

错误:SyndicationFeed.Load(读者);

第2行第2位出现错误

em System.ServiceModel.Syndication.Rss20FeedFormatter.ReadXml(XmlReader reader,SyndicationFeed result)    em System.ServiceModel.Syndication.Rss20FeedFormatter.ReadFeed(XmlReader reader)    em System.ServiceModel.Syndication.Rss20FeedFormatter.ReadFrom(XmlReader reader)    em System.ServiceModel.Syndication.SyndicationFeed.Load [TSyndicationFeed](XmlReader reader)    em System.ServiceModel.Syndication.SyndicationFeed.Load(XmlReader reader)    em stratos.Tasks.RSSImportTask.GetSourceArticles(RSSSource source,StratosContext db)na c:\ Users \ Marcelo \ Documents \ CODE \ stratos \ stratos \ Tasks \ RSSImportTask.cs:linha 213    em stratos.Tasks.RSSImportTask.Execute()na c:\ Users \ Marcelo \ Documents \ CODE \ stratos \ stratos \ Tasks \ RSSImportTask.cs:linha 147

有没有解决方法呢?

1 个答案:

答案 0 :(得分:1)

问题似乎是RSS版本。 SyndicationFeed仅支持Atom 1.0和RSS 2.0。 URL返回的RSS使用版本0.91。您可以按照以下链接的建议尝试此Argotic Syndication Framework: MS Syndication class doesn't accept valid RSS feed