public class HandlerFactory : IHttpHandlerFactory
{
public IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated)
{
// lots of code
}
public void ReleaseHandler(IHttpHandler handler)
{
// HttpContext.Current is always null here.
}
}
如何使 HttpContext.Current 可用(或使用替代方法来存储每个请求的变量,以便可以在 ReleaseHandler 中检索它们)?