Search code examples
enterprise-library

EntLibConfig.exe - change indentation on XML


The "EntLibConfig.exe" tool that comes with Microsoft Enterprise Library tends to reformat entire .config XML files after you change some of your settings in the GUI. With XML files, we have a coding standard of 4 space indentation, but EntLibConfig seems to use 2 spaces.

Is there any way to configure this tool to customize how it indents the XML is writes out? In Visual Studio, I have all the XML settings set to 4 spaces (no tabs), but this does not seem to have any effect.


Solution

  • I don't think there is any way to change the indentation from the EntLibConfig.exe tool.

    What you could do is open the generated config files in Visual Studio with the indent set to 4 spaces (which you have). Then hit Ctrl-K, Ctrl-D to format the document. This should set all of the indents to 4 spaces.

    As an aside, you could make the case that the EL config is generated code and perhaps does not need to conform to the published standard. e.g. I would not expect code generated by svcutil.exe to conform to my organizations specific coding stadards and guidelines.