-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
.NET 6
Console application
Why does this create an exception regarding BinaryFormatter not supported?
I am not using any binary formatter, and SettingsSerializeAs is set to XML.
using System.Configuration;
var provider = new LocalFileSettingsProvider();
var context = new SettingsContext();
var attributes = new SettingsAttributeDictionary();
var attr = new UserScopedSettingAttribute();
attributes.Add(attr.TypeId, attr);
var prop = new SettingsProperty(
"Test",
typeof(bool),
provider,
false,
default(bool),
SettingsSerializeAs.Xml,
attributes,
false,
false);
var propertyCollection = new SettingsPropertyCollection { prop };
var propertyValueCollection = provider.GetPropertyValues(context, propertyCollection);
var pv = propertyValueCollection["Test"];
var value = pv.PropertyValue;