Call Us:  (877) 513-3113

E-Mail:  info@tellagostudios.com

Fixing .NET configuration hell with TeleSharp: Reusing configuration sections

Reusability, or the lack of it, is one of the main problems with the .NET configuration experience. How many times do we find ourselves creating the same configuration sections over and over again as part of our .NET applications? And then when those configuration settings change we have to go change it on 20 different places.

With TeleSharp, we created a simple model that allows you to reuse the same configuration sections across the different components of you r applications. The rule is pretty simple Create it once, use it everywhere.

Let’s illustrate this in the context of a very simple scenario on which a WCF service and a WPF application need to access a database. Traditionally, we will have to copy the connection string section in both app.config files. With TeleSharp, we can accomplish this in a few easy steps.

Suppose that we have the both components already registered in TeleSharp as highlighted in the following figure.

Step 1: Create Configuration section

Initially we need to create the configuration section in TeleSharp either by uploading an application configuration file or by pasting the XML.

Step 2: Drag the configuration section onto your component

Once the configuration section has been created, we can simply dragging it onto the different component we would like to configure.

 

Step 3: When you are ready, publish the configuration sections to both deployment locations

Once the components have been configured,  we can deploy the configuration using a TeleSharp deployment container (more on deployment containers in a future post)

Step 4: You are done, go have a beer :)

It’s important to notice that after a configuration section is associated to multiple components you only need to change it once and all the components pick up the configuration change.

What do you think? Are we on the right track?