Settings.Save -> Invalid high surrogate character.

G

Guest

Hello,

I have a .net 2.0 application using a 'Settings.settings' configuration file
to store application settings. The settings are modified at runtime and
stored when the user exits the application.

Occasionaly, this exception will occur when calling the
Settings.Default.Save() method:

Invalid high surrogate character (0xDE1C). A high surrogate character must
have a value from range (0xD800 - 0xDBFF).
StackTrace: at System.Xml.XmlTextEncoder.Write(String text) at
System.Xml.XmlTextWriter.WriteString(String text) at
System.Xml.XmlText.WriteTo(XmlWriter w) at
System.Xml.XmlElement.WriteContentTo(XmlWriter w) at
System.Xml.XmlNode.get_InnerXml() at System.Xml.XmlElement.get_InnerXml() at
System.Configuration.LocalFileSettingsProvider.SerializeToXmlElement(SettingsProperty
setting, SettingsPropertyValue value) at
System.Configuration.LocalFileSettingsProvider.SetPropertyValues(SettingsContext
context, SettingsPropertyValueCollection values) at
System.Configuration.SettingsBase.SaveCore() at
System.Configuration.SettingsBase.Save() at
System.Configuration.ApplicationSettingsBase.Save() at
MyApp.frmMain.frmMain_FormClosing(Object sender, FormClosingEventArgs e) in
C:\MyApp\frmMain.cs:line 159

What could be causing this? Could one of the datatypes that I am serializing
in my settings file produce invalid characters? These datatypes are:

string
bool
int
double
long
System.Windows.Forms.FormWindowState
System.Drawing.Rectangle
System.Drawing.Point

Any suggestions would be apprecitated.

Chris
 
Top