What should I type (in both cases) in my app.config's applicationSettings section so that, when I read Settings, I can get the following:
- Settings.Default.FooString == null
- Settings.Default.FooString == string.Empty
? I guess there is no way to achieve both situations, or am I missing something?
Diffrerenciating whether string value is null or empty is unfortunately required, because this value goes to different system, that takes diffrent decisions upon these two. thanks
further info:
Settings.Designer.cs is being regenerated each time you modify the settings tab. The sample generated setting is:
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string Foo {
get {
return ((string)(this["Foo "]));
}
set {
this["Foo "] = value;
}
}
the problem is with generated [DefaultSettingValueAttribute("")]. It works as I want when I correct it by hand with [DefaultSettingValueAttribute(null)], however, I would need to do this after whenever I modify any thing on the settings tab, which is unacceptable.
any clues?