6

Our company ships an MVC based product (targeting v4.5) which has stopped working on a customer site for what appear to be environmental issues - a build which worked with no problems once upon a time now gives a 403.14 - The Web server is configured to not list the contents of this directory. .

What I think is happening...

  • The user accesses http://server/AppName
  • Because it's an MVC app, the default route (Reports/Index) should be used.
  • Instead IIS is looking for a default document...
  • ... and, not finding one, it assumes the user wants to list the contents of the directory...
  • ...which is not enabled so it throws a 403.14. .

What I've tried so far...

  • Accessing the route directly.. results in 404 error. So I'm pretty sure IIS doesn't realise it should use routing.
  • Use aspnet_regiis to register ASP.Net with IIS. This was done from the Framework64 folder since...
    • OS is 64 bit - Windows Server 2008 (Standard without Hyper-V)
    • IIS is 64 bit - though Enable 32-Bit Applications is true
  • Checked AppPool is targeting v4 of the framework - it is.
  • Changed AppPool mode to Classic - was pretty sure it should be integrated but was worth ruling it out. It is now back to Integrated
  • Confirmed RunAllManagedModulesForAllRequests is set to true in the web.config.
  • Checked permission conditions defined in <system.webServer> section of web.config are met - they are.
  • Created the simplest of MVC applications and deployed it - same problem.
  • Running the command shell as Administrator unregistered ASP.Net using aspnet_regiis -ua and re-registered using aspnet_regiis -enable -i. We hit a couple of permission problems - and the Temporary ASP.NET Files directory was missing but once they were address we were back to the same error.
  • Added a simple default.htm - when present, this is served in response to the http://server/AppName request.

I'm clean out of ideas and all google hits suggest some combination of the above - or enabling directory browsing (which I think is just a symptom rather than the root cause).

Also, not sure if it's relevant but the amount of configurable elements available for the application in IIS seems a bit below what I would have expected...

IIS Options

16
  • 1
    Do you have a folder in your app named Reports as well?
    – user3559349
    Sep 4, 2017 at 11:25
  • Good point - there is no Reports folder, just a ReportsController. Thanks for the suggestion (and for taking the time to reply)
    – amcdermott
    Sep 4, 2017 at 11:27
  • 1
    Did you change any of the boilerplate config code in route config or any of those app_data folder. Can you share that code? Sep 4, 2017 at 12:55
  • No - nothing has changed. The app was installed from an MSI. It worked previously, it doesn't now. Also, the site is pre-compiled so the customer hasn't changed it either.
    – amcdermott
    Sep 4, 2017 at 12:59
  • 1
    Apologies - when I say "nothing has changed", I am referring to the "boilerplate config code in route config". Clearly something has changed or it wouldn't have stopped working.
    – amcdermott
    Sep 4, 2017 at 13:32

8 Answers 8

1

Have you Checked the user the application pool process is running under? I think Your site needs to run with permissions to execute the .net libraries and I've seen this just change for seemingly no reason (probably related to an overzealous update to the system).

enter image description here

0

You can try with the Enabling directory browsing . assuming you are under Windows Server 2012 or Windows Server 2012 R2

  1. On the taskbar, click Server Manager.
  2. In Server Manager, click the Manage menu, and then click Add Roles and Features.
  3. In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.
  4. On the Server Roles page, expand Web Server (IIS), expand Web Server, expand Common HTTP Features, and then select Directory Browsing. Click Next.
  5. On the Select features page, click Next. On the Confirm installation selections page, click Install. On the Results page, click Close.

if you using the Windows PC try this in your command prompt as follows:

  1. go to C:\Program Files\IIS Express
  2. then press Enter:appcmd set config /section:system.webServer/directoryBrowse /enabled
0

Maybe this is your case https://forums.iis.net/t/1157304.aspx

SQL Server Reporting Services creates a folder called Reports by default if you install it on IIS. If you install SQL 2008 then Reporting Services doesn't need to use IIS and instead will try to reserve the URL with the HTTP.Sys service.

I believe this is the cause of the conflict you are seeing. What you could try is changing the URL that Reporting Services uses via the SQL Server Configuration Wizard.

Also I found that

Report Manager of SQL Server can use reports path http://<server name>/reports Configure a Native Mode Report Server for Local Administration (SSRS)

0

I think the problem is IIS features that are not installed yet. I have met this kind of problem frequently in Windows Pro. Make sure to turn on every feature under Internet Information Service -> World Wide Services because by default IIS is configured to use WebForms. So there might be some features that not installed yet to use MVC, especially ISAPI filters. In my case, that was the solution. I hope it helps.

0

Something similar i encountered using VS 2017 & ASP.NET MVC. Was working on the project for long with no problems at all but suddenly the routing started misbehaving & stopped working.

So I changed the Port in Project Properties Page & it started working.

I really don't know what is the relation between a port & MVC routing modules. Someone else can enlighten if at all this helps.

0

I had the same problem and I just created an application pool out of the Default Web Site in IIS and stoped the default web site. With that difference you will not have the application pool's path

0

I know it's been a long time since this question but i've had the same problema recently. I've tried every single configuration, just like @amcdermott did, but the only action that solve the problem was reinstalling .NET Framework.

My app was built under .NET Framework 4.5.2. The application server had the version 4.6.1 and 4.5.2 installed. So, i uninstalled all framework versions and installed the one that i needed.

Please, make sure that no other applications use superior versions of .NET Framework if you going to try this solution.

-2

Here are some quote I find on Microsoft official site which I think may help:

For site administrators

This problem occurs because the Web site does not have the Directory Browsing feature enabled, and the default document is not configured. To resolve this problem, use one of the following methods:

Method 1: Enable the Directory Browsing feature in IIS (Recommended)

To resolve this problem, follow these steps: Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK. In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify. In the Features view, double-click Directory Browsing. In the Actions pane, click Enable.

Method 2: Add a default document

To resolve this problem, follow these steps: Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK. In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify. In the Features view, double-click Default Document. In the Actions pane, click Enable. In the File Name box, type the name of the default document, and then click OK.

Method 3: Enable the Directory Browsing feature in IIS Express

Note This method is for the web developers who experience the issue when they use IIS Express.

To do this, follow these steps: Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt: C:\Program Files\IIS Express Type the following command, and then press Enter: appcmd set config /section:directoryBrowse /enabled:true

2
  • I didn't think I could make this any clearer. I don't want to enable directory browsing - I think IIS is defaulting to interpreting my request as this because it's not using the default route and there is not file called default.htm
    – amcdermott
    Sep 25, 2017 at 17:44
  • Have you tried the second method it recommend? One thing I would like to point out is that "default.htm" is just a general name indicate to the first page you want user to see. It can also be called whatever it used to be ,like index.htm, welcome.htm, etc.
    – n4feng
    Sep 25, 2017 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.