Thread: ASP.NET/Web.config Transformation Syntax for any XML configuration file

Web.config Transformation Syntax for any XML configuration file

www.hanselman.com/blog/SlowCheetahWebconfigTransformationSyntaxNowGeneralizedForAnyXMLConfigurationFile.aspx





Re: Web.config Transformation Syntax for any XML configuration file

stackoverflow.com/questions/5465090/how-to-do-a-web-config-transform-for-smtp


From:


 <mailSettings>

     <smtp from="no-reply@test.com" deliveryMethod="SpecifiedPickupDirectory">

         <specifiedPickupDirectory pickupDirectoryLocation="C:\temp"/>

         <network host="localhost"/>

     </smtp>

</mailSettings>

 


To:


<system.net>

  <mailSettings>

    <smtp deliveryMethod="Network">

      <network host="smtp.mysite.com" userName="myuser" password="mypassword" />

    </smtp>

  </mailSettings>

</system.net>

 


Via:


<system.net>

  <mailSettings>

    <smtp deliveryMethod="Network" xdt:Transform="Replace">

      <network host="smtp.mysite.com" userName="myuser" password="mypassword" />

    </smtp>

  </mailSettings>

</system.net>