473,387 Members | 3,750 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,387 software developers and data experts.

appSettings - question

Hi,

I tried to use the in-built configuration classes of the .net framework -
but I was hampered by some problems:

Reading the configuration data works just fine, but when I try to set/write
any configuration an exception occurrs saying that this property would be
readonly. What's going on here?

By the way, my main goal is to be able to write/read enormous configuration
settings (s.b.) with only few code:

public structure MySettings
dim ....[lost of declarations, also of structures]
end structure

What's the fastest way to read/write this information to disk?

Thanks
Peter
Jul 21 '05 #1
2 1196
You cannot write to the setting in .NET. The built-in classes do not
support this. The config file is only read when the application starts. If
you want the ability to change the settings, you will need to write your own
system.

"Peter Schmitz" <Pe**********@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
Hi,

I tried to use the in-built configuration classes of the .net framework -
but I was hampered by some problems:

Reading the configuration data works just fine, but when I try to set/write any configuration an exception occurrs saying that this property would be
readonly. What's going on here?

By the way, my main goal is to be able to write/read enormous configuration settings (s.b.) with only few code:

public structure MySettings
dim ....[lost of declarations, also of structures]
end structure

What's the fastest way to read/write this information to disk?

Thanks
Peter

Jul 21 '05 #2
or wait for 2.0 ;) Btw if ur using 1.1 u can take a look at the
Enterprise Library from MS that comes with a Application Configuration
Management Block... im no 100% sure but i think it allows you to write
back to the configuration file. Heres the link:
http://www.microsoft.com/downloads/d...displaylang=en

Hope this Helps,

NuTcAsE

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lobrys | last post by:
Hello everybody! Ma question est simple : Est il possible de supprimer la section appSettings en memoire pour se baser de nouveau sur le fichier de config. Resumé bref de ce que je veux...
3
by: Rudy | last post by:
Hello All! I'm just trying to set my SQL connection String in the app setting of my Web Config. I got it to work on one page, but my code is a little diffrent for another page that has a little...
2
by: Jared Hagel | last post by:
I've searched the web for a solution to this problem. Surprisingly, no problem/solution has been posted yet. We can read application configuration information fine when our asp.net application...
2
by: Fuehner | last post by:
Everyone-- I installed the .NET 2.0 framework on a server that also has version 1.1 installed. A few of my applications override the "appSettings" section in the web.config with a custom config...
1
by: Joe Van Meer | last post by:
Hi all, Why would I be getting a "Type 'AppSettings' is not defined" error when I have the configuration namespace referenced in my project? I am trying to convert my vb6 app and I want to use...
4
by: RSH | last post by:
Hi, I have a situation where I am attempting to print the contents of an AppSettings property in the aspx file of my website. Basically here is the code I am using: <% Response.Write("Email:"...
7
by: moondaddy | last post by:
I'm running a wpf windows app and want to add the appSettings element to the config file. when I do, the app wont start up and I get the following error: {"The type initializer for...
3
by: John | last post by:
Hi If I use ConfigurationSettings.AppSettings.Set("KeyName", "KeyValue"), where does the KeyName/KeyValue combination ends up? In a file? In windows registry? Thanks Regards
1
by: Ken | last post by:
I'm currently using 1.1. Is there any way using the value of a ConfigurationSettings.AppSettings as a key of ConfigurationSettings.AppSettings.Tosting( )]? for example in web.config <add...
2
by: Thomas Bauer | last post by:
Hello, I have a config file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="Directory" value="C:\_Database\" /> <add key="CloseApplication" value="0" />...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.