ASP.NET:”System.Web.HttpException: 请求在此上下文中不可用” 解决方法

项目环境:ASP.NET MVC 4
部属环境:WIN2008 X64 IIS7
异常详细信息: System.Web.HttpException: 请求在此上下文中不可用

<div>
</div>

<div>
  <small><small><strong>解决方案一:</strong></small></small>
</div>

<p>
  把Response、Request、Session写全<strong>:</strong>
</p>

<div>
  <small><small>    System.Web.HttpContext.Current.Response</small></small>
</div>

<div>
  <small><small>    System.Web.HttpContext.Current.Request</small></small>
</div>

<div>
  <small><small>    System.Web.HttpContext.Current.Session</small></small>
</div>

<div>
</div>

<div>
  <small><small><strong>解决方案二:</strong></small></small>
</div>

<div>
  <small><small>Application_Start代码段中不使用System.Web.HttpContext.Current</small></small>
</div>

<div>
  <small><small>比如</small></small>
</div>

<div>
  <small><small>    System.Web.HttpContext.Current.Request.MapPath</small></small>
</div>

<div>
  <small><small>可改用</small></small>
</div>

<div>
  <small><small>    System.Web.Hosting.HostingEnvironment.MapPath</small></small>
</div>

<div>
</div>

<div>
  <small><small><strong>解决方案三(不推荐):</strong></small></small>
</div>

<div>
  <small><small><strong>  </strong>  应用程序池,托管管道模式,设为经典</small></small>
</div>

<div>
  <small><small>    </small></small><img src="/wp-content/uploads/2018/09/06113002-77391e6ea7c64fa6b16e783a621bc7c7.png" alt="" />
</div>