Wildcard application maps in IIS7 from Web.config?

Last post 09-22-2009 10:45 AM by Peter Smith. 2 replies.

Sort Posts:

  • Wildcard application maps in IIS7 from Web.config?

    03-29-2008, 1:18 PM
    • Member
      point Member
    • blove57
    • Member since 11-16-2007, 11:48 PM
    • Posts 21

    Is there a way to turn on wildcard mapping in IIS7 from the Web.config file? I have a .NET 3.5 website with a few C# HTTP Modules such as URL redirect scripts that required "Wildcard application maps" turned on for the .NET framework (pointed to the same dll as what .aspx uses). Right now the website is running on IIS6 and did this thru the IIS6 management console. But now I've moved the website to a IIS7 shared hosting and now wanted to turn Wildcard application mapping via the Web.config file. Is this possible? I don't have IIS7 console control since it's shared.

  • Re: Wildcard application maps in IIS7 from Web.config?

    04-02-2008, 5:34 AM
    Answer

    Hi blove57,

    Yes you can. By default, handlers are not allowed to be overridden in the web.config file. They are locked in the IIS 7 configuration, you need to unlock the section to allow overriding. Here is an example using appcmd.exe to unlock this section.  The Command Prompt was running as Administrator.

    C:\Windows\System32\inetsrv>appcmd.exe unlock config /section:system.webserver/handlers

    Here is an example of web.config file with managed type as the handler.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <handlers>
                <add name="WildCard" path="*" verb="*" type="sampletype" resourceType="Unspecified" />
            </handlers>
        </system.webServer>
    </configuration>

    You can also configure the handler in IIS7 Manager, please take care of the precedence of the handlers in the list in IIS7 Manager.

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • Re: Wildcard application maps in IIS7 from Web.config?

    09-22-2009, 10:45 AM
    • Contributor
      4,290 point Contributor
    • Peter Smith
    • Member since 03-19-2005, 5:58 AM
    • Posts 1,599

    Hi,

    Your solution seems to be the one to go for. However after doing this I'm getting the error:
    Could not load type ’sampletype’.
    What are the correct type and resourceType values to use for a basic mapping of * to the UrlRewriter module?


    Zhao Ji Ma - MSFT:
    please take care of the precedence of the handlers in the list in IIS7 Manager.

    What is the correct order?

    please mark answers as 'Answered' and post back solutions when you figure stuff out that isnt in the post already.
Page 1 of 1 (3 items)