This project has moved. For the latest updates, please go here.
To enable the default handling of .rss or .rssdl files in the App_Code directory you would using a web.config like this [leaving out the standard stuff]:
<?xml version="1.0"?>
<configuration>
    <system.web>
        <compilation debug="true">
            <buildProviders>
                <add extension=".rss" type="RssToolkit.Rss.CodeGeneration.RssBuildProvider,RssToolkit"/>
                <add extension=".rssdl" type="RssToolkit.Rss.CodeGeneration.RssdlBuildProvider,RssToolkit"/>
            </buildProviders>
        </compilation>
    </system.web>
    <appSettings>
        <add key="defaultRssTtl" value="10"/>
        <add key="rssTempDir" value="~\App_Data"/>
    </appSettings>
</configuration>

This would cause any files in the App_Code directory with an extension of .rss to be handled as-if they were an cached XML copy of an RSS feed and a matching code file would be generated. The language of the generated wrapper code will match the default language of the Web Site Project or Web Application Project (as appropriate). The web.config sample above will also cause any file with an extension of .rssdl to be treated as-if it was an XML list of RSS feed URL(s). For each mentioned feed in the .rssdl file, the feed will be fetched (if a URL) or read (if a file) at compile-time and the code generated. An example .rssdl file looks like this:
<rssdl>
    <rss name="YouTube" url="http://youtube.com/rss/global/top_favorites.rss" />
    <rss name="MSNBC" url="http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml" />
</rssdl>

For this example, two strongly-typed classes would be generated at web site compile-time. The first would be the YouTubeRss class which will expose all the properties of the feed, including the enclosures and namespaced-items from Yahoo's search schema. The second would be the MSNBCRss class which would expose the properties of the MSNBC feed. In both cases, the default URL for the class would be the one specified in the .rssdl file, but you can point the class at a difference (compatible) URL at runtime as desired. The classes are otherwise exactly the same as those generated by the RssDl.exe command-line compiler (see: Consuming Feeds with RssDll Compiler).

Last edited Jun 16, 2007 at 12:26 AM by IDisposable, version 2

Comments

No comments yet.