我在web.config的标准connectionStrings元素中有一组连接字符串
web.config中的sessionState元素指示在使用sql会话状态时使用sqlConnectionString属性。
这通常导致连接字符串在文件中的2个位置被复制,并且如果有人忘记更改这两个位置,则可能导致它们不同步。
我可以使用什么机制来删除这种重复?
示例配置:
<connectionStrings>
<add name="IWouldLikeToUseThisConnectionStringForSessionState" value="..."
</connectionStrings>
<sessionState
mode="SQLServer"
allowCustomSqlDatabase="true"
sqlConnectionString="DuplicatedConnectionStringHereAndCanGetOutOfSync"
/>
处理这种情况的一种方法可能是使用Partioning,如here所述。