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.
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.
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:
Review list of installed packages/features
Let us go review list of MS Windows installed features.
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"
- 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 *
rem Syntax for adding feature dism /online /enable-feature /featurename:<feature-name> rem add IIS-ASPNET dism /online /enable-feature /featurename:IIS-ASPNET
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:
Add packages – IIS-ASPNET * (Add all dependencies)
- 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.
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:
- The HTTP status code in IIS 7.0, IIS 7.5, and IIS 8.0
- Error message when you visit a Web site that is hosted on IIS 7.0: “HTTP Error 404.17 – Not Found”
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”:
They Bring me to you
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):
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
APPPOOL object "App Pool - Eph Web User" changed
IIS and ASP.Net Modules
- Install IIS and ASP.Net Modules
Deployment Image Servicing and Management Technical Reference (DISM)
- Operating System Package Servicing Command-Line Options
- Adding features with DSM
- Managing Application Pools in IIS 7
- Specify a .NET Framework Version for an Application Pool (IIS 7)