The service cannot be activated because it does not support ASP.NET compatibility[通俗易懂]

The service cannot be activated because it does not support ASP.NET compatibility[通俗易懂]部署WCF时遇到这么个错:”Theservicecannotbeactivatedbecauseitdoesnot supportASP.NETcompatibility.ASP.NETcompatibilityisenabledforthisapplication.TurnoffASP.NETcompatibilitymodeinthewe

大家好,欢迎来到IT知识分享网。

       部署WCF时遇到这么个错:

The service cannot be activated because it does not supportASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as ‘Allowed’ or ‘Required’.” 

    长长的一大串看着很吓人,但按其中的提示来操作就行了,第一种“Turn off ASP.NET compatibility mode in the web.config”,在web配置文件里搜“serviceHostingEnvironment”,默认的配置是这样的

 <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />



把前面那个true改成false即可,如果配置文件里没有这句加上即可,加在system.serviceModel中。或者第二种即在契约类名头部加段配置就行,记得先引用相应的命名空间,不然无法智能提示,按照提示设置成Allowed或者Required.这两种方式选择其中一种设置即可。

The service cannot be activated because it does not support ASP.NET compatibility[通俗易懂]

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/25531.html

(0)
上一篇 2023-07-19 22:33
下一篇 2023-07-25 18:33

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信