310

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?

3
  • 1
    the source code would be more helpful rather then the error page
    – gsharp
    Dec 8, 2010 at 13:38
  • 1
    What part of the source code would you need to see?
    – delete
    Dec 8, 2010 at 13:40
  • 1
    After following the above instruction then also if you getting same error then go through with below link and follow the steps Click Here
    – Raj
    Mar 5, 2013 at 10:31

19 Answers 19

280

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

13
  • 244
    I had to check .NET Framework 4.5 Advanced Services > WCF Services > HTTP Activation Mar 21, 2013 at 21:54
  • 20
    run this command from an administrator command prompt: "dism /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation /all", or "dism /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation45 /all"
    – Paul Suart
    Oct 14, 2013 at 21:20
  • Just when I got used to running regiis, microsoft goes and changes it up again. Well at least this is much easier - similar change to installing WIF. Now they should add SQL to Turn Windows Features On/Off. Apr 4, 2014 at 0:52
  • 1
    @KevinBrydon - Thank you very much! Your tip was very helpful to resolve the issue on Windows 2012 R2. May 13, 2015 at 4:53
  • 1
    @KevinBrydon That solves it. That is just to awesome to be a simple comment. It has more votes than the actual answer. Maybe you should make this an answer? Dec 7, 2015 at 9:24
179

Use aspnet_regiis.exe to register version of .NET framework you are using.

This is a common issue and happens when IIS is installed after VS or .NET framework.

Note - for Windows 8/10 users, see the other answer by JohnOpincar below. And also the comment/tip from Kevin Brydon.

4
  • 11
    As a matter of fact I did install Visual Studio first and then IIS. I'm currently running "aspnet_regiis.exe -i" command. Hopefully this fixes the error.
    – delete
    Dec 8, 2010 at 13:43
  • 5
    Worked for me as well when I got this error when trying to access a .svc WCF service.
    – atconway
    Sep 20, 2012 at 12:14
  • Note - for Windows 8 users see the other answer by JohnOpincar below
    – KyleK
    Jun 12, 2015 at 13:25
  • +1 For anyone else finding this via Search you might find it easier to perform a Repair on the .NET Install instead of attempting to run aspnet_regiis.exe as the path of least resistance and resolves the issue. We're seeing this a lot on boxes that have installed .NET 4.5.2 (via Windows Update) prior to installing the IIS Role, its a bit frustrating because these boxes will show .NET 4 as an option in their app pool, but if your application requires .NET 4.5 like ours does it'll fail with the above message.
    – aolszowka
    Sep 29, 2015 at 16:01
160

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.

14
  • 5
    Works for me on Windows 10! Thank you! Jun 22, 2016 at 16:13
  • 1
    Works for me on win 8.1 also
    – Qerts
    Jul 5, 2016 at 19:31
  • Worked on Win10 iis7 May 17, 2017 at 1:51
  • This works after upgrading to Windows 1709 and having to reinstall my IIS Feb 21, 2018 at 10:38
  • Perfectly working for me.Ideal solution if you are getting like "This error occurs when the file extension of the requested URL is for a MIME type that is not configured on the server"
    – eranda.del
    Apr 2, 2018 at 14:47
95

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>
5
  • 2
    1+ it fixed my problem... i was trying to load the .json and i was keep getting the OP error and finally I end-up adding the mimeMap in my web.config and solved the problem
    – Nick Kahn
    Jul 30, 2015 at 14:08
  • Do I need to add MIME type for asmx file as well? Aug 22, 2015 at 9:01
  • @ShilpaSoni asmx files are asp.net server files (not static content). so you can't and you don't need to download them from client. Aug 23, 2015 at 19:10
  • 1
    And here's a map of file extensions to their appropriate mimeType, found from this SO question Dec 23, 2015 at 19:43
  • thanks you this works for yaml for .net framework 4.8 <staticContent> <mimeMap fileExtension=".yaml" mimeType="text/yaml" /> </staticContent> Jun 23, 2022 at 6:57
23

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
0
8

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

1
  • 2
    I checked only HTTP Activation and TCP Activation and it worked for me. Thank you anyway! Aug 22, 2016 at 3:09
7

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.

1
7

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).
3

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>

3

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.
1
  • 1
    I tested this solution in the case of .ts (Type Script Files) you must declare in the MIME type Typescript fields (.ts) I use text/x.typescript as mime type Apr 7, 2017 at 20:05
2

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.

2

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.

2

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
1

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.

1

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.

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".

0

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.

0

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" />
0

Set video to your IIS MIME Type

This solved my problems.

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