为什么这么久才更新呢?不是说好一周一篇吗?
...............好吧,我不知道说什么......


这次还是按照问答的方式来展现,最后附上一个通用简单的配置文件


问题:HTTP 错误 500.19 - Internal Server Error,无法读取配置节“protocolMapping”,因为它缺少节声明。
解决:Web.config文件中有protocolMapping节点, 发现在IIS部署时使用了.NET 2.0的应用程序池. 将其改为使用.NET 4.0的AppPool后正常


问题:HTTP 错误 404.3 - Not Found,由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射。
解决:打开“cmd”命令工具行,输入“cd c:\windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\”,然后输入“ServiceModelReg -i”,检测和重新安装


问题:HTTP 错误 500.21 ,在这个"svc-Integrated"处理器列表有一个错误的模块"ManagedPipelineHandler"
解决:打开“Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts”下的命令提示程序,32位系统打开32位,64位系统打开64位。输入“aspnet_regiis.exe -iru”,然后安装
原因:这个问题通常发生在先装visualstudio后装IIS的WCF HTTP 激活模块,如果先装IIS后装visualstudio则不会发生这个问题。


WCF配置文件

原文链接:http://www.cnblogs.com/iamlilinfeng/archive/2012/10/02/2710224.html

<?xmlversion="1.0"?><configuration><system.serviceModel><!--服务--><services><!--name:名称空间.类型名--><!--behaviorConfiguration:behavior的名称,请看behavior配置节的名称--><servicename="WCFLibrary.User"behaviorConfiguration="MyBehavior"><host><baseAddresses><!--每种传输协议的baseAddress,用于跟使用同样传输协议Endpoint定义的相对地址组成完整的地址,每种传输协议只能定义一个baseAddress。HTTP的baseAddress同时是service对外发布服务说明页面的URL--><addbaseAddress="http://localhost:8732/Design_Time_Addresses/WCFLibrary/Service/"/></baseAddresses></host><!--除非完全限定,否则地址将与上面提供的基址相关,每个服务可以有多个Endpoint--><!--Address:指定这个Endpoint对外的URI,这个URI可以是个绝对地址,也可以是个相对于baseAddress的相对地址。如果此属性为空,则这个Endpoint的地址就是baseAddress--><!--bindingConfiguration:binding的名称,请看binding配置节的名称--><endpointaddress=""binding="wsHttpBinding"contract="WCFLibrary.IUser"bindingConfiguration="myHttpBinding"><identity><dnsvalue="localhost"/></identity></endpoint><!--此终结点不使用安全绑定,应在部署前确保其安全或将其删除--><endpointaddress="mex"binding="mexHttpBinding"contract="IMetadataExchange"/></service></services><!--绑定--><bindings><wsHttpBinding><bindingname="myHttpBinding"><securitymode="None"><messageclientCredentialType="Windows"/></security></binding></wsHttpBinding></bindings><!--行为--><behaviors><serviceBehaviors><behaviorname="MyBehavior"><!--httpGetEnabled-bool类型的值,表示是否允许通过HTTP的get方法获取sevice的WSDL元数据--><serviceMetadatahttpGetEnabled="True"/></behavior></serviceBehaviors></behaviors></system.serviceModel></configuration>