<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>IIS7 - Extensibility</title><link>http://forums.iis.net/1042.aspx</link><description>Problems developing a IIS 7 module using Native or Managed code - come here for help from the experts.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Extending IIS to enable URL Rewriting in ASP.NET applications</title><link>http://forums.iis.net/thread/1420407.aspx</link><pubDate>Fri, 06 Oct 2006 09:54:49 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1420407</guid><dc:creator>mvolo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1420407.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1420407</wfw:commentRss><description>&lt;p&gt;Yeah, the runAllManagedModulesForAllRequests is special.&amp;nbsp; More in blog post as soon as I get to it.&lt;br /&gt;&lt;br /&gt;The UrlMappingsModule is an ASP.NET 2.0 feature for limited url rewriting - look here for more information: &lt;a href="http://msdn2.microsoft.com/en-us/library/ms228302.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms228302.aspx&lt;/a&gt;.&amp;nbsp; It is pretty much the same as you calling HttpContext.RewritePath.&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;</description></item><item><title>Re: Extending IIS to enable URL Rewriting in ASP.NET applications</title><link>http://forums.iis.net/thread/1420080.aspx</link><pubDate>Fri, 06 Oct 2006 02:02:36 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1420080</guid><dc:creator>nate_</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1420080.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1420080</wfw:commentRss><description>&lt;p&gt;Thanks Mike.&lt;/p&gt;&lt;p&gt;runAllManagedModulesForAllRequests=&amp;quot;true&amp;quot; has done the trick.&lt;/p&gt;&lt;p&gt;I had tried removing the managedHandler preCondition from all the managed modules but that didn&amp;#39;t work. It seems the runAllManagedModulesForAllRequests switch does something extra that allows the rewrite to work.&lt;/p&gt;&lt;p&gt;I look forward to your blog entry. It&amp;#39;ll be good to hear about what other rewriting options we have.&lt;/p&gt;&lt;p&gt;Also, i was curious about the UrlMappingsModule that is added by default. Is that something to do with rewriting, or something different. Searching the web has not turned up any information about it. Perhaps that&amp;#39;s something that will be included in your blog entry.&lt;/p&gt;&lt;p&gt;Cheers,&lt;br /&gt;Nate&lt;/p&gt;</description></item><item><title>Re: Extending IIS to enable URL Rewriting in ASP.NET applications</title><link>http://forums.iis.net/thread/1418926.aspx</link><pubDate>Thu, 05 Oct 2006 06:57:14 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1418926</guid><dc:creator>mvolo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1418926.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1418926</wfw:commentRss><description>&lt;p&gt;Unfortunately, a couple things are still pretty hard to do in the Integrated mode, and remapping the handler based on a Rewrite is one of them.&amp;nbsp; Without boring you with technical details (about which you should be able to read about in my future blog post), here is how you can work around this limitation:&lt;br /&gt;&lt;br /&gt;1. Enable all ASP.NET modules to run for all requests by setting:&lt;br /&gt;&amp;lt;modules runAllManagedModulesForAllRequests=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;NOTE: This will basically ignore the preCondition=managedHandler configuration for the default managed modules in the app, allowing all of them to run for all requests.&amp;nbsp; You may experience a performance hit for static files, but it may not be significant if most of your content is ASP.NET based as is.&lt;br /&gt;&lt;br /&gt;2. Make sure that your module is running prior to MapRequestHandler (realistically, in PostAuthorizeRequest or before) to do the RewritePath call.&lt;br /&gt;&lt;br /&gt;Let me know if this doesnt work for you.&amp;nbsp; As I said, I will try to blog about Rewriting in ASP.NET 2.0 / IIS7 and various options you have there.&amp;nbsp; This will be on &lt;a href="http://www.mvolo.com/"&gt;www.mvolo.com&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Thanks,&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Extending IIS to enable URL Rewriting in ASP.NET applications</title><link>http://forums.iis.net/thread/1417708.aspx</link><pubDate>Wed, 04 Oct 2006 02:19:05 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1417708</guid><dc:creator>nate_</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1417708.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1417708</wfw:commentRss><description>&lt;p&gt;Hi Karl,&lt;/p&gt;&lt;p&gt;I&amp;#39;m having similar difficulties finding information about url rewriting in IIS7. I&amp;#39;m keen to see what responses you get, and I don&amp;#39;t want to hijack the thread, but I&amp;#39;d also settle for being able to get the old style of url rewriting working.&lt;/p&gt;&lt;p&gt;Currently we have an application that achieves URL rewriting in IIS5 and IIS6 by using a wildcard application mapping to .NET and we have an HttpModule which calls HttpContext.RewritePath when the HttpApplication.BeginRequest event is fired. To get postback&amp;#39;s working we have our own class derived from Page which overrides the Render method and uses our own HtmlTextWriter which corrects the url in the form tag. It&amp;#39;s actually quite easy once you figure it out and it seems to work really well now in both IIS5 and IIS6.&lt;/p&gt;&lt;p&gt;With IIS7 (Vista RC1 build 5600) I realised that we could do away with the wildcard application mapping since our HttpModule would now be able to catch all requests. I&amp;#39;ve got this working, but it seems that when IIS Core chooses the HttpHandler it doesn&amp;#39;t use the rewritten url.&lt;/p&gt;&lt;p&gt;here is an example project for you to see what I&amp;#39;m talking about &lt;a href="http://nate.deepcreek.org.au/download/SampleUrlRewriter.zip"&gt;http://nate.deepcreek.org.au/download/SampleUrlRewriter.zip&lt;/a&gt; (6 KB)&lt;br /&gt;You should be able to just unzip it and point a website with a .NET 2.0 integrated App Pool at it to get it up and running.&lt;/p&gt;&lt;p&gt;requesting &lt;a href="http://localhost/database/file1.gif"&gt;http://localhost/database/file1.gif&lt;/a&gt; unexpectedly produces a 404 from the StaticFile handler even though the Requested URL is correctly rewritten.&lt;/p&gt;&lt;p&gt;HTTP Error 404.0 - Not Found&lt;br /&gt;Description: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. &lt;br /&gt;Error Code: 0x80070002 &lt;br /&gt;Notification: MapRequestHandler &lt;br /&gt;Module: IIS Web Core &lt;br /&gt;Requested URL: &lt;a href="http://test/Default.aspx?database=%2fdatabase%2fmygif.gif"&gt;http://test/Default.aspx?database=%2fdatabase%2fmygif.gif&lt;/a&gt; &lt;br /&gt;Physical Path: D:\Dev\CS\ExampleRewritePath\database\mygif.gif &lt;br /&gt;Logon User: Anonymous &lt;br /&gt;Logon Method: Anonymous &lt;br /&gt;Handler: StaticFile &lt;/p&gt;&lt;p&gt;If you request &lt;a href="http://test/Default.aspx?database=%2fdatabase%2fmygif.gif"&gt;http://test/Default.aspx?database=%2fdatabase%2fmygif.gif&lt;/a&gt; then it works fine&lt;/p&gt;&lt;p&gt;Aside from the wrong handler being used after the RewritePath the other thing i noticed is that the Physical Path was not updated to match the new url.&lt;br /&gt;To test this further, i caught the HttpApplication.MapRequestHandler event in my HttpModule and used the debugger to see the HttpRequest.PhysicalPath value. It had changed correctly to match the new url, so it would seem that the physical path in iis core is not getting updated to match the changed path in .NET. Could this be the reason that IIS Core is incorrectly choosing the StaticFile handler instead of the *.aspx handler, or is there something else I should be doing?&lt;/p&gt;&lt;p&gt;Cheers,&lt;br /&gt;Nate&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Extending IIS to enable URL Rewriting in ASP.NET applications</title><link>http://forums.iis.net/thread/1415581.aspx</link><pubDate>Mon, 02 Oct 2006 04:09:42 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1415581</guid><dc:creator>kaperlin</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1415581.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1415581</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;In researching URL rewriting in ASP.NET I have read that the reason ASP.NET
2.0 does not offer more support for URL rewriting is that this would be
deprecated or rendered obsolete by the introduction of IIS7.&lt;span&gt;&amp;nbsp; &lt;/span&gt;That said I can&amp;rsquo;t seem to find anything specifically
about URL rewriting in IIS7, other than statements that it could be
accomplished by using .NET code to extend IIS7.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Is there any documentation or articles
available that may clarify this for me?&lt;/p&gt;

&lt;p&gt;Specifically, when trying to accomplish URL rewriting in ASP.NET it seems impossible
to maintain postback functionality and the friendly url without either writing a custom form
tag or using PageParser.GetCompiledPageInstance(), which is not supported for
use outside the framework.&lt;/p&gt;&lt;p&gt;Any information would be greatly appreciated.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br /&gt;Karl&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>