[Mono-list] Does Properties.Settings.Default.Save() work under Linux

ChrisD chris.down at alcor.co.uk
Mon Apr 27 08:33:11 UTC 2015

I am having problems saving user settings under Linux. Everything works fine
if I run under Windows.

On Linux, I copy the files appname.exe and appname-exe.config to appname
directory and execute using

mono appname.exe.

As a simple example: I have created a Winform with a TextBox as use the
following code to test saving the user settings:

using System;
using System.Windows.Forms;

namespace SettingsSaveTest
    public partial class Form1 : Form
        public Form1()
            textBox1.Text = Properties.Settings.Default.TestString1;

        private void textBox1_TextChanged(object sender, EventArgs e)
            Properties.Settings.Default.TestString1 = textBox1.Text;
            Properties.Settings.Default.Save ();

I have a appname.settimgs file under Properties as follows:

="SettingsSaveTest.Properties"GeneratedClassName ="Settings">
    <SettingName ="TestString1"Type="System.String"Scope ="User">
    <ValueProfile ="(Default)">Test1</Value>
   <Setting Name ="TestString2"Type ="System.String"Scope ="User">
     <ValueProfile ="(Default)">Test1</Value>

When I change the text in the test box and quit the program the
./local/share/appname/user.config file is created and contains just the
following xml:

<?xml version="1.0" encoding="utf-8"?>
  <userSettings />

Whereas under Window user.config contains:

<?xml version="1.0" encoding="utf-8"?>
            <setting name="TestString1" serializeAs="String">

Any ideas what I may be doing wrong? 

Chris Down
View this message in context: http://mono.1490590.n4.nabble.com/Does-Properties-Settings-Default-Save-work-under-Linux-tp4665828.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list