WCF Service中HttpContext.Current为null的解决办法
2011-07-18 17:22
477 查看
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的解决办法
- ASP.NET Identity V2在多线程中UserManager获取的httpContext.Current始终为null的解决办法
- 多线程中使用HttpContext.Current为null的解决办法
- 一般处理程序中 httpContext.current.session为null的解决办法
- 多线程中使用HttpContext.Current为null的解决办法
- HttpContext.Session==null 解决办法
- 解决Asp.net Mvc中使用异步的时候HttpContext.Current为null的方法
- WCF中使用HttpContext.Current的办法
- System.Web.HttpContext.Current.Session为NULL解决方法
- 异步 HttpContext.Current 为空null 另一种解决方法
- ASP.NET多线程下使用HttpContext.Current为null解决方案
- c# asp.net webservice asmx中保存HttpContext.Current
- 解决HttpContext.Current.Request.Files返回的文件个数不正确问题
- 未能从程序集“System.ServiceModel, Version=3.0.0.0”中加载类型“System.ServiceModel.Activation.HttpModule” 的解决办法
- 使用shiro的session后,HttpSession.getServletContext() 获取一直是null的解决方法
- Spring注入service为null另类解决办法 工具类 一般类 静态 非controller