« Previous Next »

Thread: IIS 7 and ISAPI Filters

Last post 08-20-2008 3:32 PM by Paul R H. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 08-12-2008, 3:31 PM

    • Paul R H
    • Not Ranked
    • Joined on 08-12-2008, 3:17 PM
    • Posts 4

    IIS 7 and ISAPI Filters

     

    I've been using an ISAPI filter to rewrite URLs when the physical file that the URL is mapped to doesn't exist, but the place it would be mapped to based on a set rules does exist.

    This filter works properly in IIS 6 (On both Windows XP and Windows Server 2003) but I've recently tried upgrading to IIS 7 (On Windows Server 2008) and run into a problem.

    It save the physical path into a custom filter context during the URL Map notification and then does the rewriting, if necessary, during the Auth Complete notification. Most of the time this works in our new set up, but when an ASP.NET page using the 2.0 framework does a postback this breaks.

    The Auth Complete notification happens before any URL Mapping is done in this one case and so either there's no physical path in the custom filter context or the path from the last request made is there.

    Is there any way I can ensure that the URL has been mapped to a physical path before the Auth Complete notification has happened? Or some way to do the mapping myself while handling the Auth Compelte notification?
  • 08-18-2008, 11:09 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: IIS 7 and ISAPI Filters

    Can you collect failed request tracing for the failure on IIS7?

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 08-19-2008, 12:32 PM In reply to

    • Paul R H
    • Not Ranked
    • Joined on 08-12-2008, 3:17 PM
    • Posts 4

    Re: IIS 7 and ISAPI Filters

    I've tried to, but it doesn't seem to generate the trace logs when requesting an ASP file. I'm guessing this is because the application pool is set up to use classic mode since other requests that result in a 404 do generate a trace log.

  • 08-20-2008, 2:00 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: IIS 7 and ISAPI Filters

    Classic mode would have nothing to do with whether trace log is generated - just to sure, you can choose failure condition as status-code in 200-999 range to cover all requests.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 08-20-2008, 3:32 PM In reply to

    • Paul R H
    • Not Ranked
    • Joined on 08-12-2008, 3:17 PM
    • Posts 4

    Re: IIS 7 and ISAPI Filters

    It's still not generating any trace logs.

    I've got two different application pools. The only differences between these application pools are the version of the .NET framework they are running and there is a rapid-fail protection shut down executable specified for the one runing the 1.1 Framework.

     

    The one running the 1.1 Framework is the default for the site.

    The one running the 2.0 Framework is used for a particular folder and everything contained in that folder.

     Here's what I've tried and the various results:

     http://mydomain/foo.html

     http://mydomain/folderwith1.1/foo.html

    These both came up with a 404 error and generated a trace log. It showed a generic IIS 7 error page with some details.

     http://mydomain/folderwith2.0/foo.html

    I see a similar page, but no trace log is generated.

     http://mydomain/foo.aspx

     http://mydomain/folderwith1.1/foo.aspx

    These both came up with a 404 error and generated a trace log. It showed a generic ASP.NET error page.

      http://mydomain/folderwith2.0/foo.aspx

    I see a similar page, but no trace log is generated.

     There is only one trace rule specified. The path is "*" the staus codes are "200-999" ASP, ASPNET, ISAPI Extension and WWW Server are all selected as providers along with all Areas of each of the providers and the Verbosity is set to Verbose.

Page 1 of 1 (5 items)
Microsoft Communities