现在的位置: 首页 > 综合 > 正文

Resolve Error: The service cannot be activated because it does not support ASP.NET compatibility.

2013年07月01日 ⁄ 综合 ⁄ 共 677字 ⁄ 字号 评论关闭

Error Message:

 The service cannot be activated because it does not support ASP.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'.

Solution:
Turn off aspNetCompatibilityEnabled in web.config like the following.
<serviceHostingEnvironment aspNetCompatibilityEnabled="false">

If aspNetCompatibilityEnabled must be true(that may be used by other services).
You have to add the following attribute for the service class.
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
    Public Class XXXService
    ... ...

抱歉!评论已关闭.