Web projects in Visual studio support the concept of web.config transformations, making it easy to update your configuration depending on the build you are using.
Yesterday I had a hard time to remember what the exact syntax was to update a specific appsetting. So here is a small snippet to help me remember:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<appSettings> | |
<add key="SeqServerUrl" value="http://development/seq"/> | |
</appSettings> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 --> | |
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | |
<appSettings> | |
<add key="SeqServerUrl" value="http:/productie/seq" xdt:Transform="SetAttributes" | |
xdt:Locator="Match(key)"/> | |
</appSettings | |
</configuration> |