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:
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?
Use " & " instead of "&".
Why appsettings keys (in web. config) are not case sensitive ? The default comparer is a CaseInsensitiveComparer that uses the conventions of the invariant culture; that is, key comparisons are case-insensitive by default.
The <appSettings> element stores custom application configuration information, such as database connection strings, file paths, XML Web service URLs, or any other custom configuration information for an application.
You just need to use XML encoding here I believe - so &
becomes &
Try & <appSettings> <add key="Foo" value="http://foo.bar.com/?app=xxx&FormName=yyy" /> </appSettings>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With