本文介绍了最佳实践:使用会话在Windows Azure中有多个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我,如果我在的Windows Azure环境中多个实例使用会话(一个ASP.NET MVC 3应用程序中)(指多个虚拟机),那么它无需任何配置工作,或者我需要使用ASP.NET通用提供商或者我需要使用手动的AppFabric处理?

Can anyone tell me that if I use Session(inside an ASP.NET MVC 3 application) in Windows Azure environment with multiple instances(means multiple virtual machines), then it work without any configuration or I need to use ASP.NET Universal Providers or I need to handle this manually by using AppFabric?

推荐答案

您不能使用进程内会话状态,但必须使用共享会话状态提供。

You can't use in-process session state, but must use a shared session state provider.

仅支持会话状态模型是使用Azure的缓存,但你可以使用任何与Azure存储或SQL Azure中工作的人员。

The only supported session state model is to use Azure Cache, but you can use a provider that works with either Azure Storage or SQL Azure.

更新:

我写了一篇关于<一个有些文章href=\"http://hastobe.net/blogs/stevemorgan/archive/2011/08/11/howto-use-asp-net-sql-server-session-state-provider-with-entity-framework-$c$c-first-with-sql-azure.aspx\"相对=nofollow>我的博客它进入使用SQL Azure的与实体框架code首先会话状态。但愿,你会发现有用的线索还有,即使你不使用实体框架。

I wrote some articles on my blog which go into using SQL Azure for session state with Entity Framework Code First. Hopefully, you'll find useful pointers there, even if you're not using Entity Framework.

有得考虑使用标准的SQL Server会话状态提供程序是,它并没有与SQL Azure的工作时,认为这是很好的做法重试逻辑承担。

Something to bear in mind using the standard SQL Server Session State Provider is that it doesn't have the retry logic which is considered good practice when working with SQL Azure.

这篇关于最佳实践:使用会话在Windows Azure中有多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 00:39