Ho due assembly nella mia applicazione. MyApplication.BO
e MyApplication.GUI
.Impostazioni applicazione saving
Ho configurato le impostazioni delle proprietà per il mio assembly BO.
Ora quando sto cercando di compilare il seguente codice:
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 mi sta dando il seguente errore di compilazione:
Error 1 Property or indexer 'MyApplication.BO.Properties.Settings.FullNameOfTheUser' cannot be assigned to -- it is read only F:\CS\MyApplication\MyApplication.BO\MyApplicationInfo.cs 57 17 MyApplication.BO
Cosa c'è di sbagliato con il mio approccio?