Why I can't use HttpContext or HttpCookie? (Asp.Net Core 1.0)

前端 未结 2 1028
甜味超标
甜味超标 2021-01-19 04:34

Why can\'t I use HttpContext or HttpCookie? Is there a special using?

My actual usings:

using System;
using System.Collecti         


        
2条回答
  •  醉酒成梦
    2021-01-19 05:17

    The namespace for HttpContext and HttpCookie is System.Web which is part of the System.Web.dll library.

    Go right click the projects References and select Add References.... In the newly opened window click on Assemblies and then search (via the search bar in the upper right) for System.Web.

    Then you should be able to use it via

    using System.Web;
    

提交回复
热议问题