Reputation: 8877
How do I escape the &
in the app settings? I've tried \
but didn't work?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="preset" value="iPhone & iPod Touch"/>
</appSettings>
</configuration>
The &
in the preset key value causes error Illegal Syntax Expecting valid start name character
Upvotes: 5
Views: 6607
Reputation: 158319
You shouldn't escape it, bur rather encode it to &
:
<add key="preset" value="iPhone & iPod Touch"/>
Upvotes: 15