40

I have recently started an asp.net tutorial, and I want to test my page that I made with WebMatrix. How ever, there's an error:

The Web server is configured to not list the contents of this directory.

So it suggests to Enable directory browsing and go to the IIS Express install directory and run a command.

So where is this located exactly?

ThomasMX
  • 1,643
  • 2
  • 19
  • 35
  • https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc730918(v=ws.10) Admin cmd prompt> `%windir%\system32\inetsrv\appcmd set config /section:system.webServer/directoryBrowse /enabled:true` – gawkface Apr 17 '21 at 00:03
  • Related post - [Where is IIS Express 7.5 wwwroot Directory](https://stackoverflow.com/q/21946074/465053) – RBT Sep 01 '21 at 12:46

4 Answers4

38

The user Data files are present here:

C:\Users\[username]\Documents\IISExpress

If that's the error. Then you might have got the error 404.13 (Forbidden) on your browser.

You can try to edit the web.config file and add this:

<system.webServer>
   <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

This would allow the server to read the files and process them. This is a server settings error. And I think this might help you out.

Update

As suggested by jamiebarrow, you can get to that directory directly using the following path in your Windows File Explorer,

%userprofile%\documents\IISExpress
Super Jade
  • 5,609
  • 7
  • 39
  • 61
Afzaal Ahmad Zeeshan
  • 15,669
  • 12
  • 55
  • 103
  • 1
    So it says: Run appcmd set config /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the server level. But it doesn't recognize the command appcmd – ThomasMX Apr 26 '14 at 18:37
  • It is still a server allowance error. Here is a microsoft technet post: http://technet.microsoft.com/en-us/library/cc731109%28v=ws.10%29.aspx Do read it :) It would further guide you... – Afzaal Ahmad Zeeshan Apr 26 '14 at 18:38
  • 2
    This answer solved my final problem!!! I couldn't run anything. I ran the appcmd it told me to run, I set windows authentication=true and anonymous authentication=false. Those 3 actions allowed me to see and traverse directories. This answer though allowed me to actually LOAD my pages. Thank you!!! – Luminous Jan 08 '15 at 14:12
  • 1
    Sure thing, also it seems that newer versions of Visual Studio use a `.vs` folder at the same level as the project/solution where there is also an application host config file. – jamiebarrow Sep 16 '16 at 15:43
30

My directory is located here:

C:\Program Files\IIS Express
SharpC
  • 6,974
  • 4
  • 45
  • 40
Nate Anderson
  • 18,334
  • 18
  • 100
  • 135
3

Locate the registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IISExpress\<Your version>

and parameter "InstallPath".

SharpC
  • 6,974
  • 4
  • 45
  • 40
Ivan P.
  • 832
  • 2
  • 9
  • 26
0

☢ ☣ ⚠ If you are using OneDrive with Document Sync check the folder:

C:\Users\[your-account]\OneDrive\Documentos\IISExpress\config

The common way on %userprofile%\documents\IISExpress said from @Afzaal sadly not works for this case (OneDrive)

Also, remenber to make the folder always on the computer (right click on folder... onedrive option)

Juanmabs22
  • 1,194
  • 9
  • 10