[英]Everytime we publish our .NET app on Azure, users are logged off
Everytime we publish our .NET app on Azure, all users are bein logged off and to sign in again, what our users won't understand. 每次我们在Azure上发布.NET应用程序时,所有用户都会被注销并再次登录,这是我们用户无法理解的。 The user sessions are implemented using the SimpleMembership provider. 用户会话是使用SimpleMembership提供程序实现的。
Is there any way to keep user sessions alive, even after we update our app? 即使在更新应用程序之后,有什么方法可以使用户会话保持活动状态?
I think you have misunderstood what publishing does. 我认为您误解了发布的功能。 When you publish the application it will create a new instance of the w3wp.exe
process. 发布应用程序时,它将创建w3wp.exe
进程的新实例。 This is the web process where the application memory is stored (keeping it simple). 这是存储应用程序内存(保持简单)的Web进程。 If you publish you are creating a new instance and the old is getting destroyed. 如果发布,则将创建一个新实例,而旧实例将被销毁。
All sessions will be lost. 所有会话都将丢失。
For example, every time you publish the website, it will make a change to web.config
. 例如,每次发布网站时,都会对web.config
进行更改。 This will cause the application to unload and IIS to recycle. 这将导致应用程序卸载和IIS回收。
Causes: 原因:
Web.config
Changes Web.config
更改 bin folder
content change bin folder
内容更改 IIS
applicaiton pool recycle 手动IIS
应用程序池回收 If you need to keep your sessions alive then you should look at Session-State Modes 如果需要使会话保持活动状态,则应查看会话状态模式
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.