ASP.NET compatibility
標簽:
JavaScript
刚刚在ASP.NET创建一个Service,在运行时,它即显示异常:
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'.
解决方法,你需要为你的Service添加一个属性:
第#11行代码:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
上面的解决方法,它只是为单独某一个Service。如果你有多个Service时,那需要在每一个Service均需要添加上面的属性。
有一个更好的方法,就是修改web.config:
點擊查看更多內容
為 TA 點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦