473,401 Members | 2,125 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,401 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 1197
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.