Technical: Microsoft – Internet Information Server (IIS) – Error – 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.

Technical: Microsoft – Internet Information Server (IIS) – Error – 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.

Introduction:

Post some mishaps trying to get IIS back working on one of our servers.   Btw, the OS is a MS Windows 2012 running IIS 8.

Error Message:

But, when we train a web browser against the web site, we are getting an error.

Here is the error message:

Error Message – Caption



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.

Most Likely Causes:

Here are the most likely causes:
•It is possible that a handler mapping is missing. By default, the static file handler processes all content.
•The feature you are trying to use may not be installed.
•The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)
•If ASP.NET is not installed.

Detailed Error Information:

Item Value
Module StaticFileModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x80070032
Requested URL http://<webserver&gt;:80/cookingChannel/cover.aspx
Physical Path E:\Website\cookingChannel\cover.aspx

Review list of installed packages/features

Introduction

Let us go review list of MS Windows installed features.

Command Line

we will use dism…

rem get full list of installed features
dism /online /get-features /format:table

rem get list of installed packages that have net in their names
dism /online /get-features /format:table | find /I "net"

Output:

The page you are requesting cannot be served because of the extension configuration
  Tabulated Listing:

Item Value
NetFx3ServerFeatures Enabled
NetFx3 Enabled
IIS-NetFxExtensibility Disabled
IIS-NetFxExtensibility45 Disabled
IIS-ASPNET Disabled
IIS-ASPNET45 Disabled
WAS-NetFxEnvironment Disabled
AS-NET-Framework Disabled
NetFx4ServerFeatures Enabled
NetFx4 Enabled
NetFx4Extended-ASPNET45 Disabled

 Output:

  • It seems the IIS-ASPNET * features are disabled.  We know we need them as they allow IIS to use .Net Toolset.
  • Not sure as to what IIS-NetFxExtensibility * stand for
  • Also, not sure about NetFx4Extended-ASPNET45

Add packages – IIS-ASPNET *

Command Line

rem Syntax for adding feature
dism /online /enable-feature /featurename:<feature-name>

rem add IIS-ASPNET
dism /online /enable-feature /featurename:IIS-ASPNET

Error Message:


Deployment Image Servicing and Management tool
Version: 6.2.9200.16384

Image Version: 6.2.9200.16384

Enabling feature(s)
[===========================99.8%========================= ]

Error: 50

The operation is complete but IIS-ASPNET feature was not enabled.
A required parent feature may not be enabled. You can use the /enable-feature /all 
option to automatically enable each parent feature from the following list. If the 
parent feature(s) are already enabled, refer to the log file for further diagnostics.
IIS-NetFxExtensibility, NetFx4Extended-ASPNET45

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

It is obvious that I need the following features, as well:

  • IIS-NetFxExtensibility
  • NetFx4Extended-ASPNET45

Add packages – IIS-ASPNET * (Add all dependencies)

Command Line

  • Add /all to ensure that dism installs dependencies, as well
rem Syntax for adding feature
dism /online /enable-feature /all /featurename:<feature-name> 

rem add IIS-ASPNET (including dependencies)
dism /online /enable-feature /all /featurename:IIS-ASPNET

rem add IIS-ASPNET v4.5
dism /online /enable-feature /all /featurename:IIS-ASPNET45

Error Message – HTTP Error 404.17 – The Requested content appears to be script…

With ASP.Net feature enabled, let us go

New error message:

Error Message – Caption – HTTP Error 404.17 – Not Found

HTTP Error 404.17 - Not Found

The requested content appears to be script and will not be served by the static file handler.

Error-IIS-404

Side Note:

Whenever I see 404, I am happy knowing that it is Savannah calling from Atlanta…But this one seems to be a different 404; not the good one.

Most Likely Causes:

Most likely causes:

  • The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.

Things you can try:

  • If you want to serve this content as a static file, add an explicit MIME map.

Detailed Error Information:

(same as above)

What does “HTTP Error 404.17 – The requested content appears to be script” mean?

Did not know where to go with the error :

HTTP Error 404.17 - Not Found

The requested content appears to be script and will not be served by the static file handler.

… So took to Google and found a very helpful MS Posting that suggests reviewing Application pool.  The specific URLs are:

Wow Microsoft really did a good job per listing all the HTTP Status Codes, and also providing pointed recommendations per each error.

Reminds me yet again of Joshua Radin’s:  “They bring me to you”:

Joshua Radin:
They Bring me to you
http://www.youtube.com/watch?v=RoPEvtqpQkc

So let us go list our web site and application pools…

Document Web sites and Application Pools

Via appcmd.exe, let us list Web Sites and Application Pools:

Document Web sites



rem syntax - list specific web site and virtual directories 
rem under that site
rem c:\windows\system32\inetsrv\appcmd.exe list apps /site.name:"<web site name>"

rem sample : list web sites
c:\windows\system32\inetsrv\appcmd.exe list apps /site.name:"Default Web Site"

Document Application Pools



rem syntax - list app pools
rem c:\windows\system32\inetsrv\appcmd.exe list apppools

rem sample : list App Pools
c:\windows\system32\inetsrv\appcmd.exe list apppools

Output (Screen Shot):

appcmd - list appppols (filtered)

Output (Tabulated):

Item Value
Managed Version (MdgVersion) v4.0
Managed Mode (MdgMode) Classic
State Started

It seems that we are configured to target 4.0, but I know our application should be targeting .Net 2.0.  So let us go change that quickly.


c:

cd c:\windows\system32\inetsrv
appcmd.exe set apppool /apppool.name: "App Pool - Eph Web User" /managedRuntimeVersion:v2.0

  Output:

APPPOOL object "App Pool - Eph Web User" changed

References

IIS and ASP.Net Modules

Deployment Image Servicing and Management Technical Reference (DISM)

Using appcmd.exe

 

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s