473,775 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading section in app.config with new getSection method

I am trying to do what I thought would be simple to do ie reading a section
from my app.config file. I would like to have custom sections with custom
attributes and be able to read/write them.

<configSections >
<section name="customSec tion" type="what should I put here"/>
</configSections>
<customSectio n fileName="test. txt" maxIdleTime="00 :30:30" maxUsers="10" />

I read and tried some examples in msdn but it's sp really f.. complicated
when it should be so easy !!!!

There must be a way to read a section as easily as when we use appSettings
no?!
I can use appSettings but it would be nicer to group my settings inside
sections.

Please help.

Nov 21 '05 #1
0 1409

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

Similar topics

10
9471
by: Ryan | last post by:
I've created a custom configuration section that inherits (naturally) from System.Configuration.ConfigurationSection. The configuration section is working 99% fine, however I keep coming across a ConfigurationErrorException whenever I do the following: 1. Modify and save the section in code using the System.Configuration.Configuration.Save(). 2. Refresh teh section using ConfigurationManager.RefreshSection 3. Encrypt the section,...
5
10339
by: alf | last post by:
Hi folks, I'm trying to read a web.config section using RoleManagerSection settings = (RoleManagerSection)System.Configuration.ConfigurationManager.GetSection("system.web/roleManager"); and I get the following error on the page: Security Exception Description: The application attempted to perform an operation not allowed
0
1597
by: BrianKer | last post by:
Hi! It's my first discussion on this forum. First I have a exe like this below (the object can invoke by console) public class DynamicLoad { public Type AssemblyType = null; public Assembly TestAssembly1 = null; public DynamicLoad () { string load_path = "..\OuterAssembly1\OuterAssembly1.dll"; TestAssembly1 = Assembly.LoadFrom(load_path);
7
10828
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in code. The configuration section is contained within the exe (it's a simple test case!) and everything works well debugging within the IDE or if the application is deployed on a drive or share that has been granted full trust. For the share the...
1
1176
by: Mannie | last post by:
Hi! In my C++ application I use a COM Object (written in C#). When I try to call one of the methods (that tries to read settings from configuration file) I get a nasty error -0x7c812a5b (unfortunately it's hard to debug COM objects). My c# method looks as follows: public string ReadConfigValue() { System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); AppSettingsSection...
0
1209
by: Paul Buckley | last post by:
Hi, I'm trying to gain access to a configuration section from within an assembly that has been loaded using Assemly.Load(byte). There is one main exe (lets say myApp.exe) and one config file (myApp.exe.config) which contains the config section. The dll (myAssembly.dll) is a "plugin" and loaded on request. The reason we use the byte array version of Assembly.Load is that the dll can remain unlocked which allows us to overwrite it (and...
8
8986
by: shapper | last post by:
Hello, I am getting the AppSettings section as follows: AppSettingsSection appSettingSection = (AppSettingsSection)ConfigurationManager.GetSection("appSettings"); However, I am getting the following error: Unable to cast object of type
0
1837
by: captainB | last post by:
greetings! In my asp.net application, I created a custom section in web.config that contain strings that are quotes to display in my home page. Every request for my home page (default.aspx) grabs a quote based on a random index. my web.config section looks like this: <configSections> ... <section name="quotesSection" type="QuotesSection"/> </configSections> <quotesSection>
0
1750
by: valdas | last post by:
Hi, I have a problem in accessing "sqlServerCatalogNameOverwrites" section in app.config file. <configuration> <configSections> <section name="sqlServerCatalogNameOverwrites" type="System.Configuration.NameValueSectionHandler" /> </configSections> <sqlServerCatalogNameOverwrites>
0
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10267
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9915
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7463
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4014
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.