wcf错误直接上图:

无法激活服务,因为它不支持 ASP.NET 兼容性-LMLPHP

原因:

一般是因为程序添加了启用了AJAX的WCF服务而缺少相关设置出现的错误。

解决方案:

1.webconfig

<system.serviceModel>  

<behaviors>

<serviceBehaviors>

      <behavior name="">

        <serviceMetadata httpGetEnabled="true" />

       </behavior>

    </serviceBehaviors>

  </behaviors>

</system.serviceModel>

2.cs代码中

using System.ServiceModel.Activation ;

[AspNetCompatibilityRequirements (RequirementsMode=AspNetCompatibilityRequirementsMode.Required)]

05-01 00:26