Наконец-то решили эту проблему.
using System;
using System.Configuration;
using System.ServiceModel.Configuration;
namespace Esb.Service.Authorization
{
public class EsbBehaviorElement : BehaviorExtensionElement
{
private const string _windowsgroupIndexName = "windowsgroup";
public EsbBehaviorElement()
{
if (!base.Properties.Contains(_windowsgroupIndexName))
{
base.Properties.Add(new ConfigurationProperty(_windowsgroupIndexName, typeof(string)));
}
}
[ConfigurationProperty("WindowsGroup", IsRequired = false, DefaultValue = "")]
public string WindowsGroup
{
get
{
return (string)base[_windowsgroupIndexName];
}
set
{
base[_windowsgroupIndexName] = value;
}
}
public override Type BehaviorType
{
get
{
return typeof(EsbServiceBehavior);
}
}
protected override object CreateBehavior()
{
return new EsbServiceBehavior(WindowsGroup);
}
}
}
Я не знаю, почему решение Seroter работает без ctor, где нужно добавить свойство "windowsgroup" к базовому набору свойств.