Error parsing AppSettings value with a query string Error parsing AppSettings value with a query string asp.net asp.net

Error parsing AppSettings value with a query string


Replace & with & (escape it):

<add    key="ExternalSystemUrl"    value="http://domain.com/page.aspx?id={0}&action=eat&object=bacon" />

That's the common requirement for any valid XML file.

See Where can I get a list of the XML document escape characters?


In XML an ampersand tells the parser "the data immediately following this ampersand is an entity which needs to be translated." If the data immediately following is not a valid XML entity, then you get this error. If possible, use & for your ampersand within the XML.