Fasilitas transform web.config waktu publish sangat bermanfaat, misalnya untuk mengubah <appSettings> atau menambahkan customErrors=”off”.
Buka xxx.config. Contoh isinya:
[code language=”xml”]
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!–
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
–>
<authentication mode="Forms" xdt:Transform="Replace">
<forms loginUrl="http://mobidig.azurewebsites.net/SGAccount/login" timeout="2880" />
</authentication>
</system.web>
<appSettings>
<add key="MobidigUrl" value="http://mobidig.azurewebsites.net" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
</appSettings>
[/code]
Untuk melihat hasil transform klik kanan di xxx.config, pilih Preview Transform.
