Does NHibernate SysCache work in a non-web app?

2019-07-06 17:17发布

I know SysCache uses ASP caching under the hood, but since I'm not aware of the implementation of the ASP cache (and if it depends on anything IIS), I was wondering if SysCache would work in a non-web application (like a Windows Service)?

Activating it and using NHprofiler seems to show it is not.

1条回答
看我几分像从前
2楼-- · 2019-07-06 17:58

No it doesn't, Syscache is an abstraction over asp.net cache. You have to use a different cache for the service.

EDIT: I remember this blog post: http://www.hanselman.com/blog/UsingTheASPNETCacheOutsideOfASPNET.aspx They say it should be usable outside a web-environment. It's just not recommended because microsoft maintains it to be usable in a web environment. That means that you can use it now, but you might have trouble when .Net 4 (or 5, 6, 7, ...) is released.

查看更多
登录 后发表回答