简体   繁体   English

在Azure Web角色中托管的ASP.NET MVC3应用程序中是否需要SessionStateModule?

[英]Do I need SessionStateModule in my ASP.NET MVC3 application hosted in Azure web role?

In my ASP.NET MVC3 application I don't ever explicitly use SessionStateModule and so I assume I can just remove it by changing web.config . 在我的ASP.NET MVC3应用程序中,我从未明确使用SessionStateModule ,因此我假设我可以通过更改web.config删除它。 The application is hosted in Azure web role so I can't rely on per-instance session states anyway, can I? 该应用程序托管在Azure Web角色中,因此我无论如何都不能依赖于每个实例的会话状态,可以吗?

Will removing this module likely break something or can I just remove it? 删除该模块可能会破坏某些东西,还是我可以删除它?

You are right, InProc will not work on Windows Azure. 没错,InProc将无法在Windows Azure上运行。 Here some options: 这里有一些选择:

-Store session state using Sql Database -使用Sql数据库存储会话状态

-Store session state using Table storage -使用表存储存储会话状态

-Store session state using Windows Azure Caching (recommended) -使用Windows Azure缓存存储会话状态(推荐)

More information in here: 更多信息在这里:

http://msdn.microsoft.com/en-us/library/windowsazure/gg185668.aspx http://msdn.microsoft.com/zh-CN/library/windowsazure/gg185668.aspx

https://www.simple-talk.com/cloud/platform-as-a-service/managing-session-state-in-windows-azure-what-are-the-options/ https://www.simple-talk.com/cloud/platform-as-a-service/managing-session-state-in-windows-azure-what-are-the-options/

It depends on how your application is designed and what features you are using. 这取决于应用程序的设计方式以及所使用的功能。 If the application is 100% stateless, then session state can be removed. 如果应用程序是100%无状态的,则可以删除会话状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM