Web.Config AppSettings Escape Parentheses

If you need to add entries to your web.config and are using connection strings or AppSettings with parenthesis or <,>,& you will need to escape these characters as they are invalid in XML markup.

A simple way to fix this is use an online HTML encoder. Simply copy paste your code into the encoder on this site: http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/encode.aspx

Paste the output into your web.config markup. Run your program and your variable will load correctly!


  1. JetOleDb4ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\"


Post a Comment

Popular posts from this blog

Change Password in Windows Server 2012

Microsoft Flow - Renaming Files in SharePoint Online using Flow

SharePoint Set Locale Region on All Web Applications and Site Collections