Hi,
I´m creating a ServiceFactory to gain control over inicialization of my services exposed through IIS 7.
However I´m surprised by the behavior of ServiceHost. Although I have 0 configuration files for the service, wherever I Initialize a new ServiceHost, like this:
var host = new ServiceHost(typeof(MyService), baseAddresses);
Next I want to add some behaviors only if the build is in Debug mode:
#if DEBUG
host.Description.Behaviors.Add(new ServiceDebugBehavior());
#endif
However this code fails cause the ServiceDebugBehavior is already applied! Despite I have no configuration files, and no attributes applied to the service class, the host already has this behavior and 5 more applied!
Is this the expected behavior? What if I want to disable the ServiceDebugBehavior on release builds?
Thanks in advance,