This project is read-only.

how wcf config file sections works with CODE Framework

Jan 10, 2013 at 8:42 PM


I have a question regarding how the wcf config files work in sync with the framework? Say if I'd like to add a <serviceBehaviors> section in the config file to define the throttling behavior, and configure customer service to used that behavior with basichttp binding. And use the same address, say http://localhost/dev/ICustomerService/basic

Is there a way to let the code framework to take in the additional behavior? I can change the address to something like http://localhost/dev/ICustomerService/basic/myaddress in my config file. But then it's not managed by the code framework anymore (i.e. the TestServiceHost will not list this endpoint in the window). 

I wonder if there's a more elegant way to let the Code Framework to "absorb" the configuration sections?



Jan 24, 2013 at 4:22 PM


You should be able to set all the regular settings in the config file and they should still take since we are not doing anything special for that.

You can also configure all the services programmatically. The ServiceGarden class fires BeforeHostAdded and BeforeEndpointAdded events, which can be used to do anything conceivable with those hosts and endpoints. Of course while programmatic configuration works for everything, it isn't necessarily the preferred approach for some options. Throttling is probably an aspect that would be better to configure in the config file.


Feb 16, 2013 at 2:22 PM
One more additional thought on this: For the very specific need to change throttling, we are adding new features for the next release (due within a matter of days) directly to the framework.

Take a look at these docs:
Hope this helps!