[Factory Configuration] How To create a Custom App Setting in web.config with Factory Configuration component
Web icon
Forge component by Platform Maintenance
Application Type

Good afternoon OutSystems Community,

I’ve come across a simple solution using the Factory Configuration component that I’d like to share.

In some very particular circumstances you might need to create your own custom App Settings in the Web.config file. This would only be required in rare integration scenarios (Eg. with .Net libraries).

I decided to share an example in which I will do the following:

  1. Create a Shared Configuration in the Factory Configuration component that adds an Application Setting with the name “My Custom App Setting” and the value “Hello OutSystems World!” to the /configuration/appSettings section of web.config;

  2. Test my Application Setting by creating small OutSystems app that reads the setting with an extension that uses the Configuration Manager .Net class;

1. Create a Shared Configuration that adds a Custom App Setting to web.config

I started by creating a Shared Configuration in the Factory Configuration component that looks like the screenshot below (attached you can find the file Shared Configuration Value.txt).

I then associated this Shared Configuration to a test application Test_ReadDotNetAppSetting.oml  that I’ve created  (you can find the eSpace and extension attached).

2. Test Reading the Application Setting from web.config

To confirm that my Shared Configuration is working, I created a small OutSystems applicationTest_ReadDotNetAppSetting.oml and extension DotNet_ConfigurationManager.xif that uses the Configuration Manager .Net class. You can find both the eSpace and extension attached to this post. See it in action below!

Hope this is useful to someone out there!

Daniel Lourenço

Shared Configuration and Test Application.zip

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.