Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 828
mqpasta Avatar asked Jul 11 '09 07:07

mqpasta


People also ask

How do you exit ampersand in web config?

Use " & " instead of "&".


2 Answers

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

Password=abcdef!@hh&held

Note how & is replaced by &

like image 184
Fredrik Mörk Avatar answered Oct 30 '22 12:10

Fredrik Mörk


The web.config is like any other XML file, so certain characters need to be encoded.

For example, & should be written as &.

like image 35
David Wengier Avatar answered Oct 30 '22 12:10

David Wengier