473,565 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Settings.Save -> Invalid high surrogate character.

Hello,

I have a .net 2.0 application using a 'Settings.setti ngs' 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.Defaul t.Save() method:

Invalid high surrogate character (0xDE1C). A high surrogate character must
have a value from range (0xD800 - 0xDBFF).
StackTrace: at System.Xml.XmlT extEncoder.Writ e(String text) at
System.Xml.XmlT extWriter.Write String(String text) at
System.Xml.XmlT ext.WriteTo(Xml Writer w) at
System.Xml.XmlE lement.WriteCon tentTo(XmlWrite r w) at
System.Xml.XmlN ode.get_InnerXm l() at System.Xml.XmlE lement.get_Inne rXml() at
System.Configur ation.LocalFile SettingsProvide r.SerializeToXm lElement(Settin gsProperty
setting, SettingsPropert yValue value) at
System.Configur ation.LocalFile SettingsProvide r.SetPropertyVa lues(SettingsCo ntext
context, SettingsPropert yValueCollectio n values) at
System.Configur ation.SettingsB ase.SaveCore() at
System.Configur ation.SettingsB ase.Save() at
System.Configur ation.Applicati onSettingsBase. Save() at
MyApp.frmMain.f rmMain_FormClos ing(Object sender, FormClosingEven tArgs e) in
C:\MyApp\frmMai n.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.FormWindo wState
System.Drawing. Rectangle
System.Drawing. Point

Any suggestions would be apprecitated.

Chris

Aug 15 '07 #1
0 2077

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5974
by: MrNobody | last post by:
I was a Java developer so I'm used to using property files as a means to keep configuration settings for my apps. I'm wondering what options are there with ..NET? Some settings I want to include are like a root directory for a target program on the user's machine my app uses, which they would be prompted to supply at startup. Normally the...
10
4249
by: Paul Cheetham | last post by:
Hi, I am developing an application that needs to store some machine-specific settings. The application is going to be published on the network in order to keep the clients on the latest version. Because of this, I am unable to store these settings in the App.Config file, as this gets updated every time the application does, and there...
3
3171
by: Jon Slaughter | last post by:
I wrote an app that needed to save settings such as colors, fonts, etc... after hours of trying to use ConfigurationManager and AppSettings along with a few other things I finally found that I could just use global::Properties.xxx.Settings.Default.yyy where xxx is the namespace and yyy is a setting created in the settings dialog. This is...
4
2633
by: Richard Lewis Haggard | last post by:
I have an application that can't use the registry to save various user options and application settings. My first thought was to simply use an application configuration file but this approach seems flawed. The app config file appears to be updated with values while the application is running but when the application closes, the file seems to...
5
8369
by: Andy | last post by:
I need to write a VB.NET WinForms app. For this purpose I need to keep some settings of the application, like many other Windows applications do. The most obvious solution is to store settings in the XML file or registry. If it's an XML file, then I need the following: 1. Create XSD schema, and be able to validate XML file with the...
0
1045
by: Marc | last post by:
Hello, I have a problem with the settings (save and load) My.Settings in VB.NET2005. Actually, I have made a new application, then I have created a setting (with a default value) and then I publish my application. In my application (designer), if I change a setting and then save the settings, all is fine, the next time I load the...
7
3303
by: lord.zoltar | last post by:
I have a problem which I think can be solved by creating new Settings on the fly, but I'mnot sure if it's possible, or if a better solution may exists. Here's the situation: I have a project with many different dataGridViews to display data, and many of them have 10-20 columns (the actual number of displayed columns is user/client controlled,...
3
4380
by: =?Utf-8?B?Um9iIEw=?= | last post by:
I am trying to use a custom type inside settings.settings. When I create my class, I am able to add it in as the type and the value ends up showing as XML data. If I change any of the values in my class, the values do not update the settings file. Can anyone provide any insight and/or sample code on how to use a user defined class as a...
2
10053
by: =?Utf-8?B?QWFyb24=?= | last post by:
I am trying to create dynamic settings in a .NET 2.0 C# application. I need to be able to store settings on the user, but I do not know how many settings are necessary at design time because the settings are determined by a business object that is loaded into the app of which there could be one or many. I would prefer to use the same...
7
3304
by: Just_a_fan | last post by:
I save some data to an array in my program. I can reopen the setting screen and see that the data is, in fact, in the array. I then do a lot of these: My.Settings.Brkr1 = BreakerAmps(1) My.Settings.Brkr2 = BreakerAmps(2) My.Settings.Brkr3 = BreakerAmps(3) My.Settings.Brkr4 = BreakerAmps(4) My.Settings.Brkr5 = BreakerAmps(5)
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.