Special Characters in web.config file


My password contains special characters like '&' and VS giving error on this like Password=abcdef!@hh&held

How can I use special characters in my web.config file?

Best Answer

Since the web.config file is an XML file, the values need to be XML encoded:


Note how & is replaced by &