NHibernate SysCache是​​否可以在非Web应用程序中工作? [英] Does NHibernate SysCache work in a non-web app?

查看:56
本文介绍了NHibernate SysCache是​​否可以在非Web应用程序中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道SysCache在后台使用ASP缓存,但是由于我不知道ASP缓存的实现(以及它是否依赖于IIS),我想知道SysCache是​​否可以在非Web应用程序中工作(例如Windows服务)?

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)?

激活它并使用NHprofiler似乎表明不是.

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

推荐答案

不是,Syscache是​​asp.net缓存的抽象.您必须为服务使用其他缓存.

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

我记得这篇博客文章: http://www.hanselman.com/blog/UsingTheASPNETCacheOutsideOfASPNET.aspx 他们说它应该可以在网络环境之外使用.只是不建议这样做,因为Microsoft认为它可以在Web环境中使用.这意味着您现在可以使用它,但是在发布.Net 4(或5、6、7 ...)时可能会遇到麻烦.

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.

这篇关于NHibernate SysCache是​​否可以在非Web应用程序中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆