Is it possible to have an ampersand sign in an appSettings key? error: web.config value is not defined

appsettings, asp.net

Solution

You just need to use XML encoding here I believe - so `&` becomes `&`

Problem

I have the following appSettings section ``` <appSettings> <add key="Foo" value="http://foo.bar.com/?app=xxx&FormName=yyy" /> </appSettings> ``` But the IDE is giving me two errors: - Error 25 Entity 'FormName' not defined. - Error 26 Expecting ';'. It seems the & is causing a problem. I'd like to not have to splt the values up into seperate keys. Is there an elegant way around this issue?

Original source

Related problems