web.config XDT Transform Tester
Paste a base web.config and a transform file to see the merged result and a per-operation log — covers Replace, Insert, InsertBefore/After, Remove, RemoveAll, RemoveAttributes, and SetAttributes with Match/Condition/XPath locators.
What this tool does
Paste your base web.config and a transform file like web.Release.config, and this tool applies the XDT (XML Document Transform) rules and shows you exactly what changed — the merged result plus a per-operation log naming which transform touched which element and what it did. Everything runs in your Blazor Server session; nothing is sent to an external API.
Supported vs. unsupported — read this before trusting the output
This tool implements XDT with System.Xml.Linq and explicit rules, not Microsoft's own Microsoft.Web.Xdt library. It covers the transforms and locators actually documented and commonly used in web.config transforms — anything outside that list is reported explicitly as unsupported, not applied, never guessed at or silently skipped.
| Category | Supported | Not supported |
|---|---|---|
| Transform | Replace, Insert, InsertBefore, InsertAfter, Remove, RemoveAll, RemoveAttributes, SetAttributes | Anything else (e.g. custom XDT extensions) |
| Locator | Match(attributes), Condition(xpath), XPath(xpath) | Custom locator implementations |
Worked example
Base web.config:
<configuration>
<connectionStrings>
<add name="MyDB" connectionString="dev-server" />
</connectionStrings>
</configuration>
Transform:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyDB" connectionString="prod-server"
xdt:Transform="SetAttributes(connectionString)" xdt:Locator="Match(name)" />
</connectionStrings>
</configuration>
produces a result with connectionString="prod-server", and an operation log entry showing SetAttributes matched the MyDB node and set connectionString.
How to use this tool
- Paste your base
web.configinto the first editor. - Paste your transform file (
web.Release.config,web.Debug.config, etc.) into the second editor. - Click Test Transform (or Ctrl+Enter).
- Check the unsupported-constructs warning first, then review the operation log and the merged result.
Use this to test web.Release.config before your next deployment, or as a general web config transform online sanity check any time you're editing XDT by hand — the operation log catches a locator that silently matches nothing, which is the failure mode a plain text diff can't show you.
Base web.config
web.config
<configuration>
<connectionStrings>
<add name="MyDB" connectionString="Server=dev;Database=app;" />
</connectionStrings>
<appSettings>
<add key="Debug" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
</configuration>Transform file (e.g. web.Release.config)
Transform XML
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyDB" connectionString="Server=prod;Database=app;"
xdt:Transform="SetAttributes(connectionString)" xdt:Locator="Match(name)" />
</connectionStrings>
<appSettings>
<add key="Debug" xdt:Transform="Remove" xdt:Locator="Match(key)" />
</appSettings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
</configuration>Operation log
| Category | Transform | Element | Detail |
|---|---|---|---|
| Changed | SetAttributes | <add> | Set attribute(s) [connectionString] on <add>. |
| Removed | Remove | <add> | Removed <add> matched by Match(key). |
| Changed | RemoveAttributes | <compilation> | Removed attribute(s) [debug] from <compilation>. |
Resulting web.config
Merged output
<configuration>
<connectionStrings>
<add name="MyDB" connectionString="Server=prod;Database=app;" />
</connectionStrings>
<appSettings />
<system.web>
<compilation />
</system.web>
</configuration>