Re: create app.config during runtime from within code



Christian,

Well, if you really want to get rudimentary, you could create a FileStream instance and write it byte by byte.

But I doubt you want to do that.

Usually, the configuration sections have object models that you can access through the classes in the System.Configuration namespace. You could try working with these models in code and then persist them to another file (although because config files are not written to, except for user setting sections, it might be the case that there is not much support for going from the config object to XML, only vice versa).


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Christian Muggli" <christian.muggliATgmail.com> wrote in message news:553D705D-AB1A-4401-A4D6-A7B5310A303B@xxxxxxxxxxxxxxxx
can someone explain me how to create a app.config file during runtime? i see two ways:

- add a skeleton of an app.config file to the exe/dll and extract it during runtime as a resource and extract
OR
- create a app.config file using xml

is there another way?

thanks

christian

.



Relevant Pages

  • Re: parsing config files from an api... xml?
    ... >> allows one to parse and edit, update various config files on linux. ... The way XML has developed, the only way to use it is by generating it ... produce a DOM tree and hand this over to Batik to produce PNG files. ...
    (comp.os.linux.development.system)
  • Re: OleDb Connection to XML File
    ... I do this for small config data stuff all the time. ... connect to an XML file with OLE DB. ... information about the connection string parameters. ... would be best to store it in a database-like storage area. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: My windows giveth xml and it taketh away! Include path!
    ... If you just call it .xml then you won't conflict with the special magic ... ..config files. ... >info in an xml file speak of only doing this for web programming in fact, ... > screensaver, reload it and see that the new values were there, and then ...
    (microsoft.public.dotnet.xml)
  • Re: 100% pure Win32 IDE
    ... Enterprise is the XML data binding wizard. ... Just derive your config object from TComponent, stream the component in and out, and now you have an object model for your configuration settings, without needing an expensive edition of Delphi or a XML engine. ... msBinaryDFM: TMemoryStream; ... msTextDFM: TMemoryStream; ...
    (borland.public.delphi.non-technical)
  • Re: "Next Generation" kernel configuration?
    ... >> You can have my simple flat file kernel config when you pry it from ... All my experiences with the linux visual kernel ... Wasn't even thinking XML. ...
    (freebsd-hackers)