custom section in configuration files
-
type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" I want to write a custom section that can be added to configuration file (web.config)... I dont understand all the parts of the "type" attribute 1)PublicKeyToken --- Is this the one generated thru sn.exe??? 2)System.Configuration.AppSettingsSection --- Is this any name or should it be my class name 3) System.Configuration --- what about this ??? yojimbo
-
type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" I want to write a custom section that can be added to configuration file (web.config)... I dont understand all the parts of the "type" attribute 1)PublicKeyToken --- Is this the one generated thru sn.exe??? 2)System.Configuration.AppSettingsSection --- Is this any name or should it be my class name 3) System.Configuration --- what about this ??? yojimbo
red60mans wrote:
1)PublicKeyToken --- Is this the one generated thru sn.exe???
You can see the PublicKeyToken value when your assembly is made strong-named, otherwise it's a null value.
red60mans wrote:
2)System.Configuration.AppSettingsSection --- Is this any name or should it be my class name
It should be your fully qualified name of your class as you here want to create a custom config entry.
red60mans wrote:
- System.Configuration --- what about this ???
This is the namespace containing your custom config handler class. Basically, when you define a custom configuration section, you'll have to specify the handler for this section and you also need to tell the system about how to locate the type of your class. For more information, see ASP.NET Configuration [^]