How to enable Directory browsing by default on IIS Express

后端 未结 4 1413
说谎
说谎 2021-02-01 07:04

Cassini (Visual Studio development web server) by default enables directory browsing, how can I enable directory browsing on IIS Express by default? (I don\'t want to have a sep

相关标签:
4条回答
  • 2021-02-01 07:15
    1. Go to Web.config file of your project.

    2. Add the below two tags in <system.webServer> tag in web.config

    <directoryBrowse enabled="true" />

    <modules runAllManagedModulesForAllRequests="true" />

    0 讨论(0)
  • 2021-02-01 07:17

    for those coming across this years later: directory browsing can also be enabled via IIS Manager:

    IIS Manager Directory Browsing

    0 讨论(0)
  • 2021-02-01 07:19

    You should be able to use AppCmd.exe to manage IIS Express. Try this:

    appcmd set config /section:directoryBrowse /enabled:true
    

    More info on AppCmd.exe here: http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe

    0 讨论(0)
  • 2021-02-01 07:23

    you can use appcmd tool

    APPCMD (command) (object-type) <identifier> < /parameter1:value1 ... >*
    

    Where is one of the commands supported by .Most objects support this basic set of commands:

    LIST Display the objects on the machine. An optional can specify a unique object to list, or one or more parameters can be specified to match against object properties.

    ADD Create a new object with the specified object properties to set during creation.

    DELETE Delete the object specified by the .

    SET Set parameters on the object specified by .

    Enable directory browsing.

    Go to the IIS Express install directory.

    1: Enable directory browsing at the server level

    Run `appcmd set config /section:system.webServer/directoryBrowse /enabled:true`
    

    2: Enable directory browsing at the site level

    Run `appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true`
    

    Note: Run with elevated permission

    you can verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.

    Reference : IIS

    0 讨论(0)
提交回复
热议问题