我的应用程序中有两个程序集。MyApplication.BO
和MyApplication.GUI
。
我已经为我的 BO 程序集配置了属性设置。
现在,当我尝试编译以下代码时:
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 给我以下编译错误:
错误 1 无法将属性或索引器“MyApplication.BO.Properties.Settings.FullNameOfTheUser”分配给 -- 它是只读的 F:\CS\MyApplication\MyApplication.BO\MyApplicationInfo.cs 57 17 MyApplication.BO
我的方法有什么问题?