开发者

Missing HttpContext

开发者 https://www.devze.com 2022-12-26 00:17 出处:网络
I\'ve got a project which as a reference added to System.Web. However, it can\'t seem to pick up HttpContext. Doing this:

I've got a project which as a reference added to System.Web.

However, it can't seem to pick up HttpContext. Doing this:

Imports System.Web
_ApplicationBase = HttpContext.Current()

Tells me that HttpContext is not declared. If you look at the methods and properties inside System.Web there are hardly any showing: only AspHostingPermission, AspHostingPermissionAttribute, AspHostingPermissionLevel and Services.

The reference is valid and pointing to the right place. This is driving me crazy开发者_StackOverflow社区 - what have I missed?

Cheers, Matt


If this error is happening at design time then it's a case of a missing assembly reference. Make sure your project is referencing the System.Web.dll assembly.


An HttpContext object exists only during an asp.net request on the thread that is processing the request. In any other thread or process, there is no HttpContext available.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号