Citrix and .NET user application settings

If you have found that user (or application) settings are disappearing in your .NET application when you log out of Citrix, you may need to use Roaming profiles to store the settings. This will ensure that settings are persisted across Citrix logins.

This is accomplished with the following attribute in your Settings class:


[UserScopedSettingAttribute()]
[DebuggerNonUserCodeAttribute()]
[DefaultSettingValueAttribute("-1")]
[SettingsManageabilityAttribute(SettingsManageability.Roaming)]
public int DefaultCropId {
get {
   return ((int)(this["DefaultCropId"]));
}
set {
   this["DefaultCropId"] = value;
}
}

Note the SettingsManageability.Roaming option. This causes the user.appSettings file to be created under %AppData%/Roaming/ instead of %AppData%/Local/