Skip to content

Commit 55b1fe8

Browse files
author
Liudmila Molkova
authored
Do not add integratedMode precondition and add httpModule for old IIS and classic pipeline(#34)
1 parent 028d33c commit 55b1fe8

File tree

5 files changed

+260
-29
lines changed

5 files changed

+260
-29
lines changed

src/Packages/Microsoft.AspNet.TelemetryCorrelation/content/net45/web.config.install.xdt

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
33

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+
422
<system.webServer xdt:Transform="InsertIfMissing">
523
</system.webServer>
624

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+
730
<!-- Search for system.web nodes:
831
- globally
932
- under location[@path='.']
@@ -17,9 +40,9 @@
1740
<modules xdt:Transform="InsertIfMissing">
1841
<remove name="TelemetryCorrelationHttpModule" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)"/>
1942
<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)"/>
2144
<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)"/>
2346
</modules>
2447
</system.webServer>
2548
</configuration>
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
3+
<system.web xdt:Locator="XPath(//system.web[(count(parent::location) = 0) or (count(parent::location[@path != '.' and count(@path) != 0]) = 0)])">
4+
<httpModules>
5+
<add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="managedHandler" xdt:Transform="Remove" xdt:Locator="Match(type)"/>
6+
</httpModules>
7+
</system.web>
38

49
<system.webServer>
510
<modules>
611
<remove name="TelemetryCorrelationHttpModule" xdt:Transform="Remove" xdt:Locator="Match(name)"/>
712
<add name="TelemetryCorrelationHttpModule"
813
type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation"
9-
preCondition="integratedMode,managedHandler" xdt:Transform="Remove" xdt:Locator="Match(type)"/>
14+
preCondition="managedHandler" xdt:Transform="Remove" xdt:Locator="Match(type)"/>
1015
</modules>
1116
</system.webServer>
1217
</configuration>

0 commit comments

Comments
 (0)