[asp.net] "The page you are requesting cannot be served because of the extension configuration." error message

I'm getting this error message when trying to run my application. I don't know how to fix it:

HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

Here's a screenshot of the error page: alt text

What can I do to fix this error?

This question is related to asp.net iis

The answer is


In case this helps anyone, I was getting this error when attempting to run aspnet_regiis.exe:

Operation failed with 0x8007000B

An attempt was made to load a program with an incorrect format

As it turns out, the server was running 2008 64 bit and I was trying to run the 32 bit version of the utility. Running the version found in \Windows\Microsoft.NET\Framework64\v2.0.50727 fixed the issue.

c:\Windows\Microsoft.NET\Framework64\v2.0.50727>aspnet_regiis.exe -i

In my case I needed to add MIME types for each file extension that I wanted to serve to web config:

<system.webServer>
    <staticContent>
      <mimeMap fileExtension=".shp" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".dbf" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".kml" mimeType="text/xml" />
    </staticContent>
    ...
</system.webServer>

If you are trying to view an extensionless file what worked for me was adding a MIME Type: File name extension: . MIME type: text/plain

This might have some MVC implications, especially if your Static File Handler is above the Extensionless... handlers (under IIS / Handler Mappings) but might be a work around when you only need this temporarily, like activating SSL Certs.


Set video to your IIS MIME Type

This solved my problems.

Ref: https://stackoverflow.com/a/8853443/8832133


By the way, I've just found out this post: http://blogs.msdn.com/b/webtopics/archive/2010/03/19/iis-7-5-how-to-enable-iis-configuration-auditing.aspx it explains how to audit changes on IIS. For those who face similar problems I suggest to turn on auditing and later see why your site stopped working.


I've just had the same situation with my customer. We have our own product which installs a web site. The installer configures everything: the IIS pool, the site, web.config, etc.

We installed another web site using our installer. We entered the same parameters, so web.configs happened to be the same in both sites.

However, the newly installed site worked fine, while the old one didn't. Then I opened 2 IIS Manager windows and started comparing the difference in web site settings. And I found a problem.

Somebody deleted all the Handler Mappings with the old site. If you go to "Handler mappings", you should see there aspx, asmx and other extensions and names of the handlers. So, in the old site all those records were missing.

So, I would suggest first to check the "Handler mappings" - there must be a lot of records there. Create a new web site and compare to know how many should there be.

Who deleted them, a person or another program, I have no idea. If somebody can tell if there exists some tracking application which would tell that user domain\john was modifying web site at date "07.03.2012 12:34" that would be useful.


Running Windows Server 2008 R2 64bit and .net framework 4.5, ran this command from this location, and was successful:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -i

output:

Microsoft (R) ASP.NET RegIIS version 4.0.30319.0
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation.  All rights reserved.
Start installing ASP.NET (4.0.30319.0).
.....
Finished installing ASP.NET (4.0.30319.0).

I was trying to set up MediaWiki on my windows 7 pc and got this error.

My solution was to "create a global FastCGI handler mapping for php".


For Windows Server 2016

  1. Open Server Manager form
  2. Manage -> Add Roles and Features
  3. Next until Features page
  4. Check WCF Services feature with all subfeatures
  5. Next and Install

I too had this error, on Windows Server 2008 IIS 7, I had no visual studio installed so a reinstall / repair of .NET 4.0 did the trick.


Verify that the application pool in IIS (in the case of IIS7 or above) is selected as integrated. In this case, probably change to Classic can solve this problem.


Related to Server 2016, I should add:

  1. Run this command: aspnet_regiis -lv from this dir: C:\Windows\Microsoft.NET\Framework\v2.0.50727\ This gives you the best view of what is going on

  2. On Server 2016, installing .net and iis out of sequence does not seem to be a problem.

  3. What is more likely to be a problem on Server 2016 is simply that asp.net is not installed on the machine.


I fixed that on my Windows 10:

  1. Go to Control Panel - Programs and Features - Turn Windows features on or off.

  2. Select .NET Framework 4.6 Advanced Services - WCF Services

  3. Check HTTP Activation.

  4. OK done.


I fixed my issue on Windows 2012 server by Installing ALL WCF Features.

A) Server Manager > Manage[link top left] > Add Roles and Features

B) In Features > .Net Framework 4.5 Features > WCF Services

C) Check (enable) the features. I checked all.

D) Install


In Windows 8/10, you have to use

  • Open Control Panel ?
  • Programs and Features ?
  • Turn Windows features on or off ?
  • Internet Information Services (IIS) ?
  • World Wide Web Services ?
  • Application Development Features ?
  • Check the appropriate items, such as enabling ASP.NET. (i.e install the appropriate version you want to configure your websites with)

Reference: Check the solution of this question for reference


To add an extension to serve in IIS follow -

  1. Open IIS Manager and navigate to the level you want to manage.
  2. In Features View, double-click MIME Types.
  3. In the Actions pane, click Add.
  4. In the Add MIME Type dialog box, type a file name extension in the File name extension text box. ... Type a MIME type
  5. in the MIME type text box.
  6. Click OK.

PHP 7.3 Application IIS on Windows Server 2012 R2

This was a two step process for me.

1) Enable the WCF Services - with a server restart

2) Add a FASTCGI Module Mapping

1)

Go to Server Manager > Add roles and features Select your server from the server pool Go to Features > WCF Services I selected all categories then installed

2)

Go to IIS > selected the site In center pane select Handler Mappings Right hand pane select Add Module Mappings

Within the edit window:

Request path: *.php

Module: FastCgimodule

Executable: I browsed to the php-cgi.exe inside my PHP folder

Name: PHP7.3

Now that I think about it. There might be a way to add this handler mapping inside the web-config so if you migrate your site to another server you don't have to add this mapping over and over.

EDIT: Here it is. Add this to the section of the web-config.

<add name="PHP-FastCGI" verb="*" 
  path="*.php" 
  modules="FastCgiModule"
  scriptProcessor="c:\php\php-cgi.exe" 
  resourceType="Either" />

As @Mahmoodvcs mentioned i was require to set/add MIME types for the file extension that I needed to host/download directly, in this case is a Heroku's dump file (postgres's database backup), so in order to set a public IIS server where you can download this files without requiring AWS S3 bucket or HTTP shares like dropbox this is a terrific option!

<staticContent>
  <mimeMap fileExtension=".dump" mimeType="application/octet-stream" />
</staticContent>