WCF的配置文件对大小写非常敏感,要求严格使用camel命名方式,否则一定报错,示例代码如下: <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <system.serviceModel> <services> <service name="Blade.WCFService.Service.CalculatorService" behaviorConfiguration="calculatorBehavior"> <host> <baseAddresses> <add baseAddress="http://localhost:8088/calculatorService"/> </baseAddresses> </host> <endpoint address="" binding ="basicHttpBinding" contract="Blade.WCFService.Contract.ICalculate"></endpoint> </service> </services> <behaviors> <serviceBehaviors> <behavior name="calculatorBehavior"> <serviceMetadata httpGetEnabled="true" httpGetUrl=""/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration> 本文来自优快云博客,转载请标明出处:http://blog.youkuaiyun.com/bladebengbu/archive/2007/04/01/1548427.aspx