Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Please help me understand type attribute of web.config custom settings?

I am trying to define custom settings in my web.config file and I'm pretty sure I have most of it correct and it all makes sense, except the one crucial part where I don't understand what I'm supposed to use. The tutorial I used to create my SectionHandler, didn't go into an explanation of it and MSDN isn't really helping me fully understand it either.

This comes from the tutorial I used:

<section name="BlogSettings" type="Fully.Qualified.TypeName.BlogSettings,   
  AssemblyName" />

Link to Tutorial

This is from MSDN:

 type="System.Configuration.SingleTagSectionHandler" 

Yes, I am very new to ASP.NET and I'm trying to learn. I would be happy with any good references that explain what's going on here.

like image 236
mawburn Avatar asked May 18 '12 20:05

mawburn


People also ask

What type of file is web config?

web. config file is an XML-based configuration file used in ASP. NET-based applications to manage various settings that are concerned with the configuration of our website. In this way, we can separate our application logic from configuration logic.

Which settings are stored in web config file?

config file contains default and the machine-specific value for all supported settings. The machine settings are controlled by the system administrator and applications are generally not given access to this file. An application however, can override the default values by creating web. config files in its roots folder.

What is web config file Why do we use web config file?

The web. config is a file that is read by IIS and the ASP.NET Core Module to configure an app hosted with IIS.


1 Answers

Description

The type Attribute of the Section in web.config is the "path" to the corresponding ConfigurationSection class you have implemented. The ConfigurationSection class is the class that defines the section and the possible configuration content. The ConfigurationSection is the base class of all configuration sections.

This belongs to .NET in general, not only web.config.

Check out Unraveling the Mysteries of .NET 2.0 Configuration

More Information

  • MSDN - ConfigurationSection Class
  • Unraveling the Mysteries of .NET 2.0 Configuration
like image 135
dknaack Avatar answered Oct 20 '22 00:10

dknaack