none
App.Config FIle - Where is it Made? RRS feed

  • Question

  • Okay,
    I've been designing my own Code Generator for a while that handles several of the Source Code files that are build into the .Net environment.  Not only does the Generator work for these files wonderfully in matters of formatting and appearance, but also because it changes some of the underlying code.  Primarily of which is the ApplicationSettingsBase class, which is inherited by the Properties.Settings in C# or the MY.Settings in VB. 

    The SettingsSingleFileGenerator had to be replaced in order to override the "inherits" clause of the Settings object to force it to use my newly generated class that adds a lot of very helpful functionality. 

    However, in my time devising the ApplicationSettingsBase derivative, as well as the more important SettingsProvider class descendant, I was able to determine that the sole source of the generated file (settings.designer. cs/vb) is the settings.settings xml file.  This begs the question, where is the app.config file generated?

    I enter the Settings Designer GUI in VS (wheter 2008 pro, or C#/VB Express) and upon making changes to this gui, changes are made to the App.Config, as well as the settings.settings file.  Additionally, this app.config file is later copied into the EXE directory as part of the debug or release build, and is renamed to "application.exe.config".    Not to mention the creation and insertion of Connection Strings into the App.Config file.

    I'm sure we all know these results I have described, but i'm trying to find out where they is handled. 

    If my SettingsProvider defaultly provides the configuration system with an ExeConfigurationFileMap that points to another location for the Applicaiton Config file, what engine creates that file?  I have not quite seen in my research into and updating of the SettingsProvider class, anything that provided for the writing of Applicaiton Settings or ConnectionStrings, merely a read only affect upon them both, with only the User Settings set to Read/Write.  I'm curious as to how and where the initial design-time phase of Application and User Settings and Connection String are written to this App.Config file.

    Thanks
    Jaeden "Sifo Dyas" al'Raec Ruiner

    "Never Trust a computer. Your brain is smarter than any micro-chip."
    Monday, March 23, 2009 3:58 PM