WCF Service中HttpContext.Current为null的解决办法
2011-09-22 13:02
435 查看
1. 在hosting WCF的web.config中加入:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
</system.serviceModel>
2. 在Service的类定义上加上下面Attribute:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
</system.serviceModel>
2. 在Service的类定义上加上下面Attribute:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
相关文章推荐
- WCF Service中HttpContext.Current为null的解决办法
- WCF Service中HttpContext.Current为null的解决办法
- [转]WCF Service中HttpContext.Current为null的解决办法
- WCF Service中HttpContext.Current为null的解决办法
- WCF Service中HttpContext.Current为null的解决办法
- 多线程中使用HttpContext.Current为null的解决办法
- ASP.NET Identity V2在多线程中UserManager获取的httpContext.Current始终为null的解决办法
- 多线程中使用HttpContext.Current为null的解决办法
- 一般处理程序中 httpContext.current.session为null的解决办法
- WCF中使用HttpContext.Current的办法
- HttpContext.Session==null 解决办法
- 解决Asp.net Mvc中使用异步的时候HttpContext.Current为null的方法
- 异步 HttpContext.Current 为空null 另一种解决方法
- System.Web.HttpContext.Current.Session为NULL解决方法
- Why is HttpContext.Current null after await?
- HttpContext.Current.User is null after installing .NET Framework 4.5
- sharepoint 2010项目中,ashx页面获取SPContext.Current 为null的原因和解决方法
- Slow HTTP Denial of Service Attack 漏洞解决办法
- Springboot ServletContextListener @Autowired null 解决办法
- WCF HttpContext.Current为空的问题