Modify web.config to add section

I would like to add a complete section to the web.config of a particular instance that the code is deployed to. The section is as follows:
&lt system.net &gt
&lt mailSettings &gt
&lt smtp deliveryMethod=“Network” &gt
&lt network enableSsl=“true” &gt
&lt /smtp &gt
&lt /mailSettings &gt
&lt /system.net &gt

Is this possible with a .config file in my solution (pointing to a particular instance)?
Thanks in advance

Hi,

Thanks for getting in touch! To modify or add to a config file, we generally recommend defining the required change into a transform file using the transform syntax. This allows you to define multiple transform files which can be used dynamically across deployments to each environment. You can read more details in our comprehensive documentation page on configuration files.

You can also refer to Microsoft’s documentation for syntax options and examples.

https://msdn.microsoft.com/en-us/library/dd465326(v=vs.110).aspx

I hope this helps get you going! Let me know how you go and if you have any further questions going forward. :slight_smile:

Kind regards,

Kenny

NONCONFIDENTIAL // EXTERNAL

Thanks Kenneth,

I saw this out and it was helpful for adding a new key to an existing structure, however It didn’t discuss adding an entire section to the web.config.

Thanks again,

FirstCustomerSignature1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.