I have a web.config file, in connection string attribute, I have an '&' in password which creates error in parsing web.config file.
code:
<connectionStrings>
<clear/>
<add name="FamefaceDB" connectionString="Data Source=ec2-204-236-162-54.us-west-1.compute.amazonaws.com;Initial Catalog=famefacedb;User ID=Administrator;Password= t2kfPcn6?D& "/>
</connectionStrings>
The '&' in password is illegal and says hexadecimal value is illegal in XML file.
Is there any solution to this?
XML is XML and web.config must be valid XML - a "literal" &
must be written as &
1
Compare with the correct entity encoding:
<add connectionString="..;Password=t2kfPcn6?D&"/>
1See Which are the HTML, and XML, special characters? (linked by Noel in a comment) for the gritty details.
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