ASP.Net RSS Toolkit gives ASP.Net applications the ability to consume and publish to RSS feeds.

Features include:

  • RssDataSource control to consume feeds in ASP.NET applications
    • Works with ASP.NET data bound controls
    • Implements schema to generate columns at design time
    • Supports auto-generation of columns at runtime (via ICustomTypeDescriptor implementation)
  • Caching of downloaded feeds both in-memory and on-disk (persisted across process restarts)
  • Generation of strongly typed classes for feeds (including strongly typed channel, items, image, handler) based on a feed URL (the toolkit recognizes RSS, Atom and RDF feeds) or a file containing a sample feed. Allows programmatically download (and creation) of feeds using strongly-typed classes.

The toolkit includes:

  • Consuming feeds, using:
    • Stand-alone command line feed compiler that generates VB.Net or C# code files.
    • Build provider for .rssdl file (containing the list of feed URI(s) [including local files])
    • Build provider for .rss file (containing feed XML in RSS/Atom/RDF or OPML format)
  • Support for generation of feeds in ASP.NET application including:
    • RSS HTTP handler (strongly typed HTTP handlers are generated automatically by the build providers) to generate the feed.
    • RSS Hyper Link control (that can point to RSS HTTP handler) to create RSS links
    • Optional secure encoding of user name into query string to allow generation of personalized feeds
  • Set of classes for programmatic consumption and generation of RSS feed in a late-bound way, without using strongly types generated classes

How-to(s):

Packaging

The toolkit is packaged as an assembly (DLL) that can be either placed in GAC or in ‘bin’ directory of a web site application. It is also usable from client (including WinForms) applications.
RSS Toolkit works in Medium Trust (RssToolkit.dll Assembly either in GAC or in ‘bin’) with the following caveats:
  • If the ASP.NET application consumes RSS feeds, the trust level must be configured to allow outbound HTTP requests.
  • To take advantage of disk caching, there must be a directory (configurable via AppSettings["rssTempDir"]) where the trust level policy would allow write access. However, disk caching is optional.

History

  • 6/15/2007 New Release (version 2.0.0.0)
    • Huge revamp of the project by Piyush Shah http://blogs.msdn.com/shahpiyush/default.aspx to support strong-type feed generation. Added support for Atom, RDF. Added OPML aggregation, and schema validation of OMPL sub-feeds. Added ability to serve out feeds as RSS, Atom, RDF or OPML. Now supports qualified namespaces and enclosures. Download manager now can cache to application relative paths (like the App_Data directory of a web site) to aid in medium trust deployments. Added unit tests via Visual Studio Team Foundation test framework.
  • 3/26/2006 Update (version 1.0.0.1)
    • Added MaxItems property to RssDataSource to limit the number of items returned.
    • Added automatic generation of <link> tags from RssHyperLink control, to light up the RSS toolbar icon in IE7. For more information please see http://blogs.msdn.com/rssteam/articles/PublishersGuide.aspx
    • Added protected Context property (of type HttpContext) to RssHttpHandlerBase class, to allow access to the HTTP request while generating a feed.
    • Added generation of LoadChannel(string url) method in RssCodeGenerator so that one strongly typed channel class can be used to consume different channels.
    • Fixed problem expanding app relative (~/…) links containing query string when generating RSS feeds.

Origins

The ASP.NET RSS Toolkit was conceived and created by Dmitry Robsman http://blogs.msdn.com/dmitryr/ and posted here by permission. Original blog postings:
Release 1.0.0.0 http://blogs.msdn.com/dmitryr/archive/2006/02/21/536552.aspx
Release 1.0.0.1 http://blogs.msdn.com/dmitryr/archive/2006/03/26/561200.aspx
Last edited Jun 16 2007 at 4:29 AM by IDisposable, version 14
Comments
Also available: 3 reviews for current release.

eddie wrote  Jan 24 at 1:17 AM 
i occasionally get errors such as the one below when using this component. it's my understanding that this error is due to the feed supplier being temporarily unavailable. please advise on whether there is a graceful way to handle this? thanks


Application information:
Application domain: /LM/W3SVC/9949656/ROOT-1-128455797479488750
Trust level: Full
Application Virtual Path: /
Application Path: G:\Inet\MySite.com\wwwroot\
Machine name: XXXXX

Process information:
Process ID: 6352
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: WebException
Exception message: The operation has timed out

Request information:
Request URL: http://www.MySite.com/Default.aspx
Request path: /Default.aspx
User host address: XXX.XXX.95.97
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 9
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Net.HttpWebRequest.GetResponse()
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state)
at System.Xml.XmlTextReaderImpl.OpenUrl()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at RssToolkit.Rss.DownloadManager.DownLoadFeedDom(String url) in C:\Dev\CodePlex\Active\ASPNETRSSToolkit\v2\RssToolkit\Rss\DownloadManager.cs:line 204
at RssToolkit.Rss.DownloadManager.GetFeedDom(String url) in C:\Dev\CodePlex\Active\ASPNETRSSToolkit\v2\RssToolkit\Rss\DownloadManager.cs:line 176
at RssToolkit.Rss.DownloadManager.GetFeed(String url) in C:\Dev\CodePlex\Active\ASPNETRSSToolkit\v2\RssToolkit\Rss\DownloadManager.cs:line 61
at RssToolkit.Rss.RssDocumentBase.Load[T](Uri url) in C:\Dev\CodePlex\Active\ASPNETRSSToolkit\v2\RssToolkit\Rss\RssDocumentBase.cs:line 120
at RssToolkit.Web.WebControls.RssDataSource.get_Rss() in C:\Dev\CodePlex\Active\ASPNETRSSToolkit\v2\RssToolkit\Web\WebControls\RssDataSource.cs:line 92
at RssToolkit.Web.Design.RssDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Dev\CodePlex\Active\ASPNETRSSToolkit\v2\RssToolkit\Web\Design\RssDataSourceView.cs:line 64
at System.Web.UI.WebControls.BaseDataList.GetData()
at System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource)
at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e)
at System.Web.UI.WebControls.BaseDataList.DataBind()
at System.Web.UI.WebControls.BaseDataList.EnsureDataBound()
at System.Web.UI.WebControls.BaseDataList.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

valli_an wrote  Feb 18 at 6:06 AM 
When I am trying to load an atom feed, then I get the following StackTrace, what am I doing wrong?

Error Message: Object reference not set to an instance of an object. Source: FeedsCollectService StackTrace: at FeedsCollectService.Post.GetNewPostsFromUrl(Feed feed) in C:\Inetpub\wwwroot\FeedsCollectService\FeedsCollectService\FeedsCollectService\Classes\Post.cs:line 144 at FeedsCollectService.FeedsCollect.feedGetTimer_Elapsed(Object source, EventArgs e) in C:\Inetpub\wwwroot\FeedsCollectService\FeedsCollectService\FeedsCollectService\Service1.cs:line 86

I am running a windows service, which collects the feeds. When I debug it gets error on line: 357 of RssXmlHelper.cs when consuming feeds like: http://googlepress.blogspot.com/atom.xml or others. I think it is not able to get the resource stream AtomToRss20.xsl, I am not sure though.

Please help ASAP.
Thanks.

Salar wrote  Mar 24 at 7:10 PM 
The created RSS with this toolkit does not work with FireFox. I mean FireFox can't show or list them.
I think the problem is schema of RSS document.

bastb wrote  May 31 at 11:21 AM 
The RSS does work with firefox. I verified version 2.0.0.14. You need to make sure the Content-Type is set to "text/xml":
context.Response.AddHeader("Content-Type", "text/xml");

I created the RSS document using rss.ToXml(DocumentType.Rss)

mikeon wrote  May 31 at 1:08 PM 
Consider changing order of elements in generated RSS xml.
Currently title, link and some other elements are below items. That prevents some aggregators (bloglines) from correctly parsing the feed - i.e. title is not found.

bstrackany wrote  Aug 15 at 7:34 PM 
Same issue as eddie -- if the RSS feed isn't available, my page hangs for a bit & then crashes. It would be nice to set a timeout or have it cache feeds for a while.

bstrackany wrote  Aug 15 at 7:39 PM 
Ah actually looks like there's caching in there.

eddie wrote  Sep 16 at 5:51 PM 
i either don't know how to use the cache or it's not working in my case. when the feed is unavailable page it breaks the whole thing.

also, it would be nice to be able to add nofollow to the outbound links

Updating...