configurationsection

System.Configuration.ConfigurationSection not available under a class library

I'm migrating a piece of functionality from my App_Code directory to a separate project that's going to build a class library to be referenced by my web app. One of my classes in the App_Code piece inherits form System.Configuration.ConfigurationSection, like so: Imports System.Configuration Imports System.Web.Configuration Imports Mic...

Nested custom configuration section

Hello, I'm trying to access my app.config file which has nested element and I'm unable to do so. I will appreciate any help... <configSections> <section name="settings" type="test1.CustomSettingsConfigSection, test1" /> </configSections> <settings> <types> <type name="type1"> <add name="testName1" value="testVa...

Intellisense for custom config section problem with namespaces

I have just rolled a custom configuration section, created an accompanying schema document for Intellisense and added it to the Web.config's Schemas property as per Michael Stum's answer to another similar question. Unfortunately, and possibly due to me creating the XSD by hand with limited knowledge, the Intellisense relies on an xmlns...

Can't load a manifest resource with GetManifestResourceStream()

Hi, I've created a custom configuration section using XSD. In order to parse the config file that follows this new schema, I load the resource (my .xsd file) with this: public partial class MonitoringConfiguration { public const string ConfigXsd = "MonitoringAPI.Configuration.MonitoringConfiguration.xsd"; public con...

TimeSpan of days in configuration?

It appears that ConfigurationElement of TimeSpan cant handle values larger than 23:59:59. Are there any workarounds? Is subclassing TimeSpan, and making a new TimeSpanValidatorAttrib even going to work? I need to handle timespans from a few minutes to a few days. I'm using the following configuration section [ConfigurationProperty...

Read settings / sections from the web.config or app.config file

Hello, I have many Connection strings in my web.config file. I also have a "dataConfiguration" setting in the same file which specifies what database my app connects to. How do I read the "defaultDatabase" setting / section from the Please see below xml file. Many thanks in advance <configuration> <configSections> </configSecti...

How to get the values of a ConfigurationSection of type NameValueSectionHandler

Hello, I'm working with C#, Framework 3.5 (VS 2008). I'm using the ConfigurationManager to load a config (not the default app.config file) into a Configuration object. using the Configuration class, i was able to get an ConfigurationSection, but i could not find a way to get the values of that section. in the config, the Configuratio...

How to read system.webserver configuration section?

Hi everybody. Is there any 'nice' way to read configuration section group of IIS7 by using WebConfigurationManager o anything? I tried to read the authorization section but WebConfigurationManager.GetSection() returns an 'IgnoredSection' instance. This is what my code looks like... authSection = WebConfigurationManager.GetSection("sy...

Creating a typed configuration class using MS Enterprise Library 5.0

I have a ASP.Net 4.0 web application for which I need to create typed configuration class. What I mean is as follows: class SettingsClass { int count; string name; decimal amount; } Should map to the configuration file as: <MyAppSettings> <xmlSerializationSection type="..."> <SettingsClass> <count>...

Merge a section NameValueSectionHandler of two .config files (C#)

I need merge a section of type NameValueSectionHandler from two .config files (Main.config and Secundary.config in sample). The Main.config has another sections like appsetings and others. Main.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="ParserSQL.Reglas" type="System.Configura...