How can I transform DefaultDocument in ASP.NET. I was able to transform other tags using Key. But in my Web.config "Key" attribute is not allowed in web config.
Web.Config
<defaultDocument>
<files>
<add Key="DefaultDocument" value="Document1.aspx" />
</files>
</defaultDocument>
SecondWeb.config
<system.webServer>
<defaultDocument>
<files>
<add key="DefaultDocument" value="Document2.aspx" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
</files>
</defaultDocument>
</system.webServer>
You just need to add defaultDocument element to the every config transformation file like this: