I have two assemblies in my application. MyApplication.BO and MyApplication.GUI .
I configured preference properties for my BO build.
Now when I try to compile the following code:
public class MyApplicationInfo { private string _nameOfTheUser; public string FullNameOfTheUser { get { return _nameOfTheUser; } set { _nameOfTheUser = value; } } public void Save() { try { MyApplication.BO.Properties.Settings.Default.FullNameOfTheUser = this.FullNameOfTheUser; MyApplication.BO.Properties.Settings.Default.Save(); } catch (Exception ex) { throw ex; } } }
VS2005 gives me the following compilation error:
Error 1 The property or indexer 'MyApplication.BO.Properties.Settings.FullNameOfTheUser' cannot be assigned - it is read-only F: \ CS \ MyApplication \ MyApplication.BO \ MyApplicationInfo.cs 57 17 MyApplication.BO
What is wrong with my approach?
c # application-settings
anonymous
source share