简体   繁体   中英

Error parsing RSS feed with C#/Mono on Mac using SyndicationFeed.Load()

I'm running the following code on both Windows and OSX, parsing the same source:

XmlReader r = new XmlReader(feedURI);
SyndicationFeed feed = SyndicationFeed.Load(r);

Both Visual Studio and Xamarin Studio work like a charm on Windows. Xamarin Studio on Mac fails on the second line. The exception thrown is related to the parsing of "pubDate" XML field (while lastBuildDate, which is in the same format, works).

The feed I'm trying to parse is at the following url: http://www.tntvillage.scambioetico.org/rss.php?c=0&p=10

I tried fixing this by inheriting XmlTextReader in a custom class as shown here:

Exceptions with DateTime parsing in RSS feed use SyndicationFeed in c#

with no luck.

Any help would be really appreciated.

Argotic库可以解决问题,它可以在.NET Framework和Mono上工作,后者在Mac OSX环境中执行时不会抛出任何异常。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM