IIS7 MVC routing not working

Our company ships a product based on MVC (targeting on v4.5), which stops working on the client’s site, which seems to be an environmental issue - an assembly that worked without problems, once now gives 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
  • Since this is an MVC application, the default route ( Reports/Index ) should be used.
  • Instead, IIS looks for the default document ...
  • ... and, not finding it, he assumes that the user wants to list the contents of the directory ...
  • ... which is not included, so it returns a value of 403.14. .

What have I tried so far ...

  • Accessing the route directly .. leads to error 404. So I pretty much know that IIS does not understand that it should use routing.
  • Use aspnet_regiis to register ASP.Net in IIS. This has been done from the Framework64 folder since ...
    • OS - 64 bit - Windows Server 2008 (Standard without Hyper-V)
    • IIS is 64 bits, although Enable 32-Bit Applications is true
  • Checked that AppPool targets v4 frameworks - this is it.
  • AppPool mode changed to Classic - I was sure that it should be integrated, but it was worth fixing it. Back to Integrated
  • Confirmed RunAllManagedModulesForAllRequests set to true in web.config .
  • The validated permission conditions defined in the <system.webServer> web.config section are <system.webServer> .
  • Created the simplest of MVC applications and deployed it - the same problem.
  • Starting a shell as an unregistered ASP.Net administrator using aspnet_regiis -ua and re-registering with aspnet_regiis -enable -i . We removed a couple of permission problems - and the Temporary ASP.NET Files directory was missing, but as soon as they were the address, we returned to the same error.
  • A simple default.htm is added - if it is present, it is sent in response to a request to http: // server / AppName .

I am cleared of ideas, and all google hits offer some combination of the above - or the inclusion of directory browsing (which, I think, is more of a symptom than the main reason).

Also, not sure if this is relevant, but the number of custom elements available for an application in IIS is slightly lower than what I would expect ...

IIS Settings

+5
source share
8 answers

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

  • On the taskbar, click Server Manager.
  • In Server Manager, select the Manage menu and click Add Roles. and Features.
  • In the Add Roles and Features Wizard, click Next. Select and click "Next." Select the destination server and click Next.
  • On the Server Roles page, expand Web Server (IIS), expand Web Server, expand General HTTP Functions, and select Directory. View. Click "Next."
  • On the Select Features page, click Next. When installing Confirm, select the page, click "Install." On the Results page, click Close.

if you are using a windows pc, try the command line:

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

Have you checked the user if the application pool process is running? I think that your site should run with permissions to execute .net libraries, and I saw that this is just a change, apparently for no reason (probably due to an excessive system update).

enter image description here

0
source

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

SQL Server Reporting Services creates the Default Reports folder if you install it in IIS. If you install SQL 2008, then Reporting Services should not use IIS and will instead try to reserve the URL using the HTTP.Sys service.

I believe that this is the cause of the conflict that you see. What can you try to change the URL that Reporting Services uses through the SQL Server Configuration Wizard.

I also found that

SQL Server Report Manager can use the report path http://<server name>/reports Configure your own report server for local administration (SSRS)

0
source

I think the problem is with IIS features that are not installed yet. I often encountered this problem in Windows Pro. Be sure to include each feature in Internet Information Service -> World Wide Services, because by default IIS is configured to use WebForms. Thus, there may be some features that are not yet installed to use MVC, especially ISAPI filters. In my case, that was the solution. Hope this helps.

0
source

I met something similar with VS 2017 and ASP.NET MVC. For a long time I worked on the project without any problems, but suddenly routing started to behave badly and stopped working.

So, I changed the port on the project properties page and started working.

I really don't know what the relationship is between port routing modules and MVC. Someone else can enlighten, if that helps at all.

0
source

I had the same problem and I just created the application pool on the default website in IIS and stopped the default website. With this difference, you will not have a path to the application pool

0
source

I know a lot of time has passed since this question, but I recently had the same problem. I tried every configuration, like @amcdermott, but the only solution that solved the problem was to reinstall the .NET Framework .

My application was built under the .NET Framework 4.5.2. Version 4.6.1 and 4.5.2 were installed on the application server. So, I uninstalled all versions of the framework and installed the one that I needed.

Please make sure that no other applications use enhanced versions of the .NET Framework if you intend to try this solution.

0
source

Here are some quotes that I find on the official Microsoft website , which I think might help:

For site administrators

This problem occurs because the directory browsing feature is not enabled on the website and the document is not configured by default. To resolve this issue, use one of the following methods:

Method 1: Enable Directory Browsing in IIS (Recommended)

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

Method 2. Add a default document

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

Method 3: Enable Directory Browsing in IIS Express

Note. This method is intended for web developers who encounter a problem when using IIS Express.

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

-1
source

Source: https://habr.com/ru/post/1271495/


All Articles