17

I am trying to match element by element name, I have to change sessionState element timeout in release, but I cannot match it by any attribute value.

<sessionState timeout="5000"/>

How can I match this element in Web.Release.config?

Andrija
  • 14,037
  • 18
  • 60
  • 87

2 Answers2

36

this should work:

<sessionState timeout="2000" 
 xdt:Transform="SetAttributes(timeout)">
</sessionState>
drzaus
  • 24,171
  • 16
  • 142
  • 201
tranceporter
  • 2,241
  • 1
  • 21
  • 23
4

In case there are those that would like to change all attributes here it is

<sessionState xdt:Transform="SetAttributes" xdt:Locator="XPath(/configuration/system.web/sessionState)" 
                mode="SQLServer"
                stateConnectionString="tcpip=1234.00" 
                sqlConnectionString="myConnection"
                cookieless="false" 
                timeout="2000"  />
Terry H
  • 327
  • 5
  • 11