473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

App.Config changes lost

427 Expert 256MB
Hi,

I have an application config file in which i create a key, i dont give this key a value. when the user runs the application, they will select a value which must then be stored to this key.

I use C# with the following code:

Expand|Select|Wrap|Line Numbers
  1. Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
  2.  
  3. config.AppSettings.Settings["ProfilesWorkingDirectory"].Value = dlgWorkingDir.SelectedPath;
  4.  
  5. config.Save();
Now this works fine, the user selects a value and the application remembers this value. But when i close the project and rebuild the solution, the value is gone.

Is the build procedure over writing the config file?
Why am i losing that value?

Thanks in advance
Aug 8 '08 #1
1 1281
Is the build procedure over writing the config file?

Yes. Once you build the application, you may be able to exclude it from your project so it is not overwritten again. You can also just use two versions and use the development version to overwrite the deployed version (minus the web.config).
Aug 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: david | last post by:
I found my web.config file always in lock mode, when I tried to modify it, I ofter got "Can not create web.config" error. I had to reboot my machine, and before I accessed any site I can modify it....
10
by: Daniel P. | last post by:
I have a Windows Forms app in C#. I created the myApp.exe.config file and it works fine if I just run the exe. When I try to debug it from Visual Studio it does not see it and throws an...
2
by: Anna | last post by:
I added a small Web.Config file to the root of my website so that I could view errors on a machine other than the server: <configuration> <system.web> <customErrors mode="Off" /> </system.web>...
3
by: Christopher Kimbell | last post by:
I have a class library that contains a number of TableAdapters and I'm using this from a web application. Is there a way of getting the TableAdapters to use the connectionstrings defined in...
0
by: marfi95 | last post by:
I have 2 questions. First a little background. I have an app that is used by my entire team to parse files and some other stuff that we normally do during the day. This app is driven very...
6
by: baerland | last post by:
Hi all! I have browsed through houndreds of threads with problems conserning web.config, but not yet found a solution to this problem. I have a test server running .NET 1.0, 1.1 and 2.0 I...
17
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
10
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= | last post by:
This has been working perfectly for months. Since we switched from ASP.NET 1.1 to 2.0, we have constant and sporadic issues with updating our applications. Touching the web.config works about...
0
by: bwooster47 | last post by:
Is there any way to get the functionality of the %config RPM directive using python distutils? http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html %config /etc/foonly This...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.