2011-04-28 103 views
1

我有一台WCF服务在我的机器上运行,当我在调试模式下运行我的visual studio 2008时,这个服务被激活。一切工作正常,直到我试图添加一个新的网站到我的IIS 7.5。现在,当我以调试模式启动客户端时,我收到以下错误消息。WCF错误| IIS 7.5 | 500.24

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;'. 

我不确定是什么原因造成这种情况,请你帮我解决吗?

以下是我的IIS 7.5的配置.. 匿名身份验证=启用 ASP.NET模拟:启用 基本身份验证:启用 Forms身份验证:启用 Windows身份验证:启用

我引用我的web服务从我的客户端配置文件如下。 http://localhost:2336/Service.svc

请注意,此服务是我的项目的一部分,并没有明确添加到IIS。当我的客户在调试模式下运行,并在web.config文件中为

<authentication mode="None"/> 

而且我怀疑,这开始发生了身份验证设置即可自动启动后,我安装的Skype,意志有什么与此?

感谢, -Mike

回答

0

请按照下面的步骤为:

  1. 首先,确保WCF使用IIS和ASP.NET(确切版本)正确注册。 有关如何register WCF with IIS and ASP.NET的详细信息。

  2. 其次,打开IIS并转到您的网站/虚拟目录的高级设置。在“高级设置”弹出窗口中,将应用程序池更改为“Classic .NET AppPool”,然后单击确定。

要记住的重要一点是我们应用程序使用的应用程序池应该有两个重要的设置。 a)AppPool的管理管道模式应该设置为“Classic”而不是“Integrated”。 b)AppPool的.NET Framework版本应与我们用于WCF服务的版本相同。

有了这两个设置,我们可以为我们的应用程序创建和使用新的AppPool,我们不需要特定于“Classic .NET AppPool”。

3

我只是在工作中涉及此错误(字面上得到同样的输出)。问题是当应用程序在集成模式下运行时启用了模拟。要修正,添加以下到web.config为服务:

<configuration> 
    <system.webServer> 
    <validation validateIntegratedModeConfiguration="false" /> 
    </system.webServer> 
</configuration> 

这将绕过集成模式验证,检查“<的System.Web/HttpHandlers的>和<的System.Web /的HttpModules >部分作为还有冒充” source

More info that helped me