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 >