|
1 | 1 | <?xml version="1.0" encoding="utf-8" ?> |
2 | 2 | <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> |
3 | 3 |
|
| 4 | + <!-- Insert global system.web node in any case --> |
| 5 | + <system.web xdt:Transform="InsertIfMissing"> |
| 6 | + </system.web> |
| 7 | + |
| 8 | + <!-- Search for system.web nodes: |
| 9 | + - globally |
| 10 | + - under location[@path='.'] |
| 11 | + - under location[count(@path)=0] |
| 12 | + If any of above contains httpModules section - it will be reused. |
| 13 | + Otherwise it will be created under /configuration/system.web (globally) |
| 14 | + --> |
| 15 | + <system.web xdt:Locator="XPath(//system.web[(count(parent::location) = 0) or (count(parent::location[@path != '.' and count(@path) != 0]) = 0)])"> |
| 16 | + <httpModules xdt:Transform="InsertIfMissing"> |
| 17 | + <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" xdt:Transform="Remove" xdt:Locator="Match(type)"/> |
| 18 | + <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" xdt:Transform="InsertIfMissing" xdt:Locator="Match(type)"/> |
| 19 | + </httpModules> |
| 20 | + </system.web> |
| 21 | + |
4 | 22 | <system.webServer xdt:Transform="InsertIfMissing"> |
5 | 23 | </system.webServer> |
6 | 24 |
|
| 25 | + <!-- Only one validation node is allowed to be deinfed globally or in global location tags. See explanaition above for httpModules on how it works --> |
| 26 | + <system.webServer xdt:Locator="XPath(//system.webServer[(count(parent::location) = 0) or (count(parent::location[@path != '.' and count(@path) != 0]) = 0)])"> |
| 27 | + <validation validateIntegratedModeConfiguration="false" xdt:Transform="InsertIfMissing" /> |
| 28 | + </system.webServer> |
| 29 | + |
7 | 30 | <!-- Search for system.web nodes: |
8 | 31 | - globally |
9 | 32 | - under location[@path='.'] |
|
17 | 40 | <modules xdt:Transform="InsertIfMissing"> |
18 | 41 | <remove name="TelemetryCorrelationHttpModule" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)"/> |
19 | 42 | <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" |
20 | | - preCondition="integratedMode,managedHandler" xdt:Transform="Remove" xdt:Locator="Match(type)"/> |
| 43 | + preCondition="managedHandler" xdt:Transform="Remove" xdt:Locator="Match(type)"/> |
21 | 44 | <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" |
22 | | - preCondition="integratedMode,managedHandler" xdt:Transform="InsertIfMissing" xdt:Locator="Match(type)"/> |
| 45 | + preCondition="managedHandler" xdt:Transform="InsertIfMissing" xdt:Locator="Match(type)"/> |
23 | 46 | </modules> |
24 | 47 | </system.webServer> |
25 | 48 | </configuration> |
0 commit comments