项目中,用到了WCF Service服务,用的是Windows身份验证,正常登陆后 HttpContext.Current=null
解决方法——
1.在Web.config文件中添加配置项
<system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> </system.serviceModel>
2.在Service类文件上添加Attribute
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
时间: 2024-10-11 07:20:36