Click here to Skip to main content
15,867,594 members
Articles / Web Development / IIS

The Curious Case of Internet Information Services

Rate me:
Please Sign up or sign in to vote.
4.76/5 (15 votes)
20 Sep 2010CPOL4 min read 61.1K   31   13
A series of problems in IIS

Introduction

Any developer would agree that Microsoft products, especially the IIS, often throw up unusual situations. This mainly happens after a major product upgrade. We get so used to the old one that we want to hang on to that forever and refuse to adjust to the settings of the new version. The objective of this paper is to describe the idiosyncrasies of IIS (mainly 7.5) that I have faced under different situations. I have documented some of the problems and their solutions.

The intention is to get a knowledge base going so that others could benefit from these tips and save some valuable time brainstorming on those completely confusing error messages that IIS throws up!!

Note – For each situation mentioned below, I have also mentioned the version of IIS and the Operating System on which they were encountered. The solutions would also be specific to that Operating System unless otherwise mentioned. You need to adjust accordingly if you are using some other OS.

Problem #1 - Problem Hosting WCF Services in IIS (IIS 7.5, OS – Windows 7)

If you are hosting WCF services .svc file 1st time on IIS 7.5, you are most likely to get the following error:

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

This is because the HTTP Handler configured by default for any virtual directory will not have the mapping for the .svc extension. This is what you have to do to get things working:

  1. Go to command prompt.
  2. Navigate to the following folder using DOS command:
    C:\Windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation
  3. Type:
    ServiceModelReg –i

You should be all set. Now if you go to your directory and check Handler Mappings, you should see .svc mapped to svc-ISAPI-2.0. Refer to the screenshot below:

Curious-Case-IIS/ServiceModelReg.jpg

Problem #2 - Cannot see Windows Authentication in IIS (IIS 7.5, OS – Windows 7)

By default, IIS 7.0 has only the following authentication modes:

  • Anonymous (Enabled by default)
  • Impersonation (Disabled by default)
  • Forms (Disabled by default)

What happened to the good old Windows Authentication? Well, to make things easy for us (pun intended), Microsoft decided not to enable them by default. If you need to see them in your IIS Authentication page, then you need to do the following things:

  1. Go to - Start -->Control Panel -> Programs and Features
  2. Click -> Turn Windows Features On / OFF on the left hand pane
  3. Find Internet Information Services and expand
  4. Expand World Wide Web Services
  5. Expand Security
  6. Select the Windows Authentications from the list and click OK.

Refer to the screenshots below:

Curious-Case-IIS/WindowsAuth.jpg

Curious-Case-IIS/WindowsFeatures.jpg

Curious-Case-IIS/image004.jpg

Problem #3 - Error - Login Failed for User 'IIS APPPOOL\Classic .NET

I encountered this when my Web service was trying to access a database with Windows Credentials. The Host Server has SQL Server 2008 and the HTTP request was routed through IIS 7.5.

The solution to this problem lies in changing the Identity property of the process model of the Classic .NET Application pool. If this has occurred, then most probably, you have your virtual directory mapped to Classic .NET App Pool.

  1. Open IIS Manager (Run -> inetmgr)
  2. In IIS Manager, Select Application Pools
  3. Right Click -> Classic .NET App Pool. Click Advanced Settings
  4. Browse to the Identity Property in Process Model
  5. Change it from ApplicationPool Identity to Local System

You should be all set. Refer to the screenshots below:

Curious-Case-IIS/image005.jpg

Curious-Case-IIS/image006.jpg

Problem #4 - Problem Hosting HTTP Handlers (IIS 7.5, OS – Windows 7)

I faced this problem when I was trying to host a HTTP Handler in IIS 7.5. I placed my DLL in the Bin folder of my virtual directory and set up a web.config file with the necessary ISAPI filter mapping. When I was trying to access the HTTP handler, I got the following error message:

HTTP Error 500.23 - Internal Server Error

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

This might be because your virtual directory is mapped to an Application Pool which has Managed Pipeline Mode = Integrated. You need to change it to Classic. To do that, follow either of the following:

Method #1 – Change the Managed Pipeline mode of the Application Pool that your virtual directory is mapped to. By default, your virtual directory will be mapped to the DefaultAppPool which works on Integrated Managed Pipeline mode.

  1. Open IIS manager (Run -> inetmgr)
  2. Click on Application Pools. Select the DefaultAppPool -> Double Click
  3. Change the managed Pipeline Mode from Integrated to Classic.

Curious-Case-IIS/image007.jpg

Method #2 – Create a new Application for your virtual directory:

  1. In Inetmgr -> Select your Web Directory
  2. Right Click -> Remove
  3. Right Click -> Select Convert to Application.
  4. Select Classic.NetAppPool.

You should be all set. In either case, you are mapping your Virtual Directory to communicate using Classic Managed Pipeline Mode.

Refer to the screenshots below:

Curious-Case-IIS/image008.jpg

Curious-Case-IIS/image009.jpg

Curious-Case-IIS/image010.jpg

Summary

I hope this document helps explain some of the common obscure problems with IIS. I plan to add more information as I get it. Readers are welcome to add and share their experiences as well.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Australia Australia
I am a Senior Software Developer / Technical Consultant in a leading software company.

Comments and Discussions

 
QuestionReading Registry or .ini files from ISAPI Extension Pin
Roland Smith4-Feb-11 12:34
Roland Smith4-Feb-11 12:34 
GeneralAnother IIS 7.5 issue Pin
MarosA13-Oct-10 23:11
MarosA13-Oct-10 23:11 
Generala different problem Pin
Seishin#22-Sep-10 4:46
Seishin#22-Sep-10 4:46 
GeneralRe: a different problem Pin
anshudutta22-Sep-10 8:32
anshudutta22-Sep-10 8:32 
GeneralRe: a different problem Pin
Seishin#22-Sep-10 8:33
Seishin#22-Sep-10 8:33 
QuestionDuplicate Image and ApplicationPool Identity Pin
E. Anderson21-Sep-10 5:23
E. Anderson21-Sep-10 5:23 
AnswerRe: Duplicate Image and ApplicationPool Identity Pin
anshudutta21-Sep-10 18:35
anshudutta21-Sep-10 18:35 
GeneralRe: Duplicate Image and ApplicationPool Identity Pin
InfRes21-Sep-10 23:55
InfRes21-Sep-10 23:55 
GeneralRe: Duplicate Image and ApplicationPool Identity Pin
anshudutta29-Sep-10 4:10
anshudutta29-Sep-10 4:10 
Answer500.23 Internal Error Pin
InfRes20-Sep-10 22:54
InfRes20-Sep-10 22:54 
GeneralRe: 500.23 Internal Error Pin
anshudutta21-Sep-10 22:36
anshudutta21-Sep-10 22:36 
GeneralRe: 500.23 Internal Error Pin
InfRes21-Sep-10 23:42
InfRes21-Sep-10 23:42 
GeneralNice! Pin
jw12320-Sep-10 21:18
jw12320-Sep-10 21:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.