在.net Core 中像以前那样的使用HttpContext.Current

NoSuchKey