|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Modify app.config in C# application I am newbie in C# application that uses the app.config file to set up various things: for example, the path to store the files on the workstation on which the application is installed. Can we, after installing the program manually modify app.config to change the values associated with keys? For now the application does not include my changes ... Apparently this is not the right way to go ... So how do handle this sort of thing? |
#2
| |||
| |||
Re: Modify app.config in C# application Well you can add/modify keys or values in your file app.config (it is for that), but it still requires that the application is coded to reflect these changes. If you added to such a tag <user name="foo" password="password"/>, we must know that your application is likely to have a <user> with attributes in the app. config |
#3
| |||
| |||
Re: Modify app.config in C# application thank you, but still how ... 1) on my dev platform, my application gets the value of a variable <add key="path" value="c:\thing"> stored in app.config with ConfigurationManager.AppSettings["path"].OK. 2) on a pc user who installs the application, the value of "path" should be changed to "c:\widget". The thing is, I manually alter the app.config placed in the directory where the application is installed, and that it completely ignores the new value of "c:\widget". In fact, I try just to have a good old file .ini ... |
#4
| |||
| |||
Re: Modify app.config in C# application In the directory where you installed your Application, the app. config must be under the name "yourApplic.exe.config". it is not called "app.config" once compiled. Sorry I had forgotten this detail |
#5
| |||
| |||
Re: Modify app.config in C# application Quote:
If the app.config file was originally created in a dll project , you wont be able to edit the values(or you cannot use it , even if you edited). Instead if the app.config file is in exe project , (\MyProject\bin\Debug\myproject.exe.config) , then it is possible to edit the values , and use the new values at runtime. |
#6
| |||
| |||
Re: Modify app.config in C# application Hi, after a lot of struggling I found a way to change the settings in a dll without recompiling and wrote a post about it, if you are having trouble changing them in the main app I also added a Demo that may help you. http://moebiusit.com/blog/pabloroman...-re-compiling/ |
![]() |
|
Tags: app config, application, csharp, modify |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to make application for changing/modify file permission | dinafrinsi | Software Development | 1 | 28-04-2012 01:43 PM |
Config.xml not specified. Valid config.xml file must be authored when deploying '(null)' Error 25004 | Jaiya | Operating Systems | 8 | 18-04-2011 08:09 AM |
Error parsing c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config on startup | Jaiya | Operating Systems | 5 | 17-04-2011 08:51 AM |
Difference between Web.Config and Machine.Config File | Adrina_g | Software Development | 5 | 23-01-2010 02:44 PM |
How to do web.config for an application | Pandya | Software Development | 3 | 06-03-2009 11:19 AM |