Search code examples
wcfiis-7wcf-bindingwcf-securitywcf-client

WCF error|IIS 7.5|500.24


I have a WCF service running on my machine, which get lauched while I run my visual studio 2008 in debug mode. Everything was working fine until I tried to add a new web site to my IIS 7.5. Now when I launch my client in debug mode..I'm recieving the following error.

The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title>IIS 7.5 Detailed Error - 500.24 - Internal Server Error</title> 
<style type="text/css"> 
<!-- 
body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;background:#CBE1EF;} 
code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;} 
.config_source code{font-size:.8em;color:#000000;} 
pre{margin:0;font-size:1.4em;word-wrap:break-word;} 
ul,ol{margin:10px 0 10px 40px;} 
ul.first,ol.first{margin-top:5px;} 
fieldset{padding:0 15px 10px 15px;} 
.summary-container fieldset{padding-bottom:5px;margin-top:4px;} 
legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} 
legend{color:#333333;padding:4px 15px 4px 10px;margin:4px 0 8px -12px;_margin-top:0px; 
 border-top:1px solid #EDEDED;border-left:1px solid #EDEDED;border-right:1px solid #969696; 
 border-bottom:1px solid #969696;background:#E7ECF0;font-weight:bold;'.

I'm not sure what is causing this, can you please help me out?

The following is my IIS 7.5 configuration.. Anonymous Authentication=enabled ASP.NET Impersonation:Enabled Basic Authentication:Enabled Forms Authentication:Enabled Windows Authentication:Enabled

I'm referencing my webservice from my client config file as follows.. http://localhost:2336/Service.svc

Note that this service is part of my project and is not added to IIS explicitly. It is launched automatically when my client runs in debug mode and inside the web.config file the authentication is set as

 <authentication mode="None"/>

Also I suspect that this started happening after I install Skype, will that have anything to do with this?

Thanks, -Mike


Solution

  • Please follow the steps below as:

    1. Firstly, ensure that WCF is registered properly with IIS and ASP.NET (exact version). For details on how to register WCF with IIS and ASP.NET.

    2. Secondly, Open IIS and go to Advanced Settings of your website/virtual directory. In "Advance Setting" popup, change the Application Pool to "Classic .NET AppPool" and click ok.

    Important thing to remember is that the Application Pool that is being used by our application should have two important settings. a) Managed Pipeline Mode of AppPool should set to "Classic" instead of "Integrated". b) .NET Framework Version of AppPool should be the same we used for the WCF service.

    Having these two settings, we can create and use a new AppPool for our application and we don't need to be specific to "Classic .NET AppPool".