Hello.
Your help is very much appreciated.
I am running tens of web applications [framework 2.0] on a local web server in an Intranet environment.
At the moment, changing the configuration settings or security settings of each application is a nightmare.
Our helpdesk team (non programmers) need to guess where the settings are located (web.config, sql server) and change it there –> impossible and not practical.
I would like to create a facility(with user interface) that centralizes the management of the configuration setting & security settings of all Intranet applications. So that our help desk team will be able to use user interface and manage settings of each of the applications easily.
At the moment:
1. Each application saves its configuration settings in its web.config.
2. Application that require security uses its web config or SqlRoleManager( the .Net built-in aspnet_membership).
How can it be achieved?!
I looked at deploying the ASP.NET’s ‘Web Site Administration Tool’ on the web server, and build user interface that will send it the correct parameters to manage each of the application (however, I discovered that the tool ‘does not know’ anything about aspnet_membership stored in SQL SERVER.
Thank you,
Loading
roy royPosted Apr 8, 2008, 4:34 PM
What I am after is to enable help desk staff, to use 1 tool to manage all the web sites, without needing to search for web config (and potentially breaking the application).
Bechir BejaouiPosted Apr 8, 2008, 5:55 AM
you can derive a class form the ConfigurationSection witch is an abstract class
add a 'namesapce'
yournamespace
{
public class CutomizedSectionHandler : ConfigurationSection
{
}
}
then you implement it with your attribute for example for a port we use a key and value attributes//Second property: The port Key
[ConfigurationProperty("key", DefaultValue = "Account", IsRequired = true)]
[StringValidator(InvalidCharacters = "|~!@#$%^&*()[]{}/;'\\",MinLength = 1)]
public string Key
{ get { return (string)this["key"]; }set { this["key"] = value; }}
//Third property: The port serial
[ConfigurationProperty("serial", DefaultValue = "9000",IsRequired = true)]
[StringValidator(InvalidCharacters = "|~!@#$%^&*()[]{}/;'\\", MinLength = 1)]
public string Serial
{get { return this["serial"] as string;}set {this["serial"] = value;}}
//Define a new section handler
yournamespace.CutomizedSection oCostomSection;
oCostomSection = new yournamespace.PortSectionHandler();
if (oConfiguration.Sections[oCostomSection.SectionName] == null)
{
// Set its name
oCostomSection.SectionName = "Port1";
//Add it to the configuration's sections
oConfiguration.Sections.Add(oCostomSection.SectionName, oCostomSection);
//Save the given section in the configuration file
oCostomSection.SectionInformation.ForceSave = true;
oConfiguration.Save(ConfigurationSaveMode.Full);
//The application should be restarted to visualize the new adding settings
Application.Restart();
}
if you excute this above code a customized configuration section will be created in the configuration file of your application.I shouldn't miss my 9 articles about the configuration settings that I will publish as soon as possible.