This project is read-only.

dynamic xml config file for out of process SLAB host?

Topics: Using
May 29, 2014 at 5:38 PM
I am part of a small development team for a large scale application that is being rewritten in C# & MVC. The Enterprise Library and more specifically, the SLAB, piqued my interest and I can see huge benefits for leveraging this feature. In the interest of trying to fully leverage object oriented programming techniques in our system, I have created a single console app that can run code in multiple C# libraries controlled by the command line parameters. I would like to log to a flat file sink but create a separate file for each library called by the console app. Ideally, I would want to use the xml config file with a custom out of process SLAB host service for the most flexibility so that I can make changes in a production environment without rebuilding my app. The command line arguments for the console app would be used in generating the filename of the flat file. I envision entering a variable name for the file attribute of the flat file sink node in the xml config file. Would this be possible or am I getting myself into trouble by attempting to do this? By the way, is there any documentation on creating the custom host app besides the code snippet in the Ent Lib dev guide? Thanks in advance. Love the power behind the Ent Lib and SLAB!
May 29, 2014 at 5:48 PM
Feel free to persue this further. I just wanted to let you know that you could still update the logging settings at runtime without re-building, even when using in-process. You'd have to do a little work yourself (as is the case with the scenario you were mentioning).
An example on how to achieve this (in-process dynamic reconfig) can be found in the SLAB and LAB quickstarts that can be downloaded from (look for the EnterpriseLibrary6-QuickStarts-source.exe file).

Marked as answer by sbattagl on 7/2/2014 at 4:06 PM
May 29, 2014 at 11:04 PM
Julian, Wow! I hadn't thought of that. Since the work my app would be doing is batched up in discrete chunks, there's no need for me to make an out-of-process SLAB host app just to process an xml config file. Your tip is very helpful. I already checked out the QuickStart apps and have gotten ideas on how to do this.