How can I use System.Web.Caching.Cache in a Console application?

后端 未结 6 592
死守一世寂寞
死守一世寂寞 2021-02-01 03:47

Context: .Net 3.5, C#
I\'d like to have caching mechanism in my Console application.
Instead of re-inventing the wheel, I\'d like to use System.Web.Caching.Cache

6条回答
  •  难免孤独
    2021-02-01 04:05

    The documentation for the Cache constructor says that it is for internal use only. To get your Cache object, call HttpRuntime.Cache rather than creating an instance via the constructor.

提交回复
热议问题