Andrija
Andrija

Reputation: 14487

match element name in web.config transformation

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?

Upvotes: 20

Views: 6442

Answers (2)

Terry  H
Terry H

Reputation: 347

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"  />

Upvotes: 4

tranceporter
tranceporter

Reputation: 2261

this should work:

<sessionState timeout="2000" 
 xdt:Transform="SetAttributes(timeout)">
</sessionState>

Upvotes: 39

Related Questions