如果web.config动态更改,会话将过期 [英] session expires if web.config dynamically changes

查看:64
本文介绍了如果web.config动态更改,会话将过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对web.config中的连接字符串进行加密,所以我尝试使用RSAProtectedConfigurationProvider使其工作正常.加密和解密正在工作,但会话已过期,因为web.config动态更改,所以请任何人告诉我如何进行会话如果web.config更改不过期

谢谢

srinivas

i want to encrypt the connectionstring in web.config so i tried with RSAProtectedConfigurationProvider so it is working fine.encryption and decryption is working but the session is expired because the web.config changes dynamically so please anyone tell me how to make session not to expire if web.config changes

thanks

srinivas

推荐答案

会话已过期,因为web.config动态更改
如果您正在修改web.config文件,那么您也应该知道它的后果.

它是一个应用程序配置文件. web.config文件中的任何更改都会触发AppDomain的重新加载,以便web.config中的设置立即生效.
不过,有一种方法可以使用restartOnExternalChanges

在这里阅读所有相关信息: MSDN:管理对配置设置的更改 [
session is expired because the web.config changes dynamically
If you are modifying your web.config file then you should know the consequences of it too.

It''s a application configuration file. Any change in the web.config file triggers a reload of the AppDomain, so that settings from the web.config take effect immediately.
Though, there is a way to handle it using restartOnExternalChanges

Read all about it here: MSDN: Managing Changes to Configuration Settings[^]


这篇关于如果web.config动态更改,会话将过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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