I am generating an XML document from a StringBuilder, basically something like:
string.Format(\"{0}{1}>
I also get the same error in an ASP.NET application when I saved some unicode data (Hindi) in the Web.config file and saved it with "Unicode" encoding.
It fixed the error for me when I saved the Web.config file with "UTF-8" encoding.