The ASP.NET Web.config File Demystified

This is an article discussion thread for discussing the SitePoint article, “The ASP.NET Web.config File Demystified

Great article. Simple, yet it covers the important topics.

Too simplistic for me. Very brief overview. Could be useful for beginners but many IDE’s have templates for web.config with comments for most items, so I’d rather wanted a more detailed article. Sorry vriend :slight_smile:

yes brief, but a good starter for the completely frightened programmer…

many times new programmers are afraid of any type of config files, so they avoid them like the plague, it is good for a brief intro…

but yes, I would like to see a follow up article with more indepth info…

I don’t know what is happening, but i want to go on msn so i can talk to my friends! please let me on!! Thanks.

Just a quick note for C# Developers:

the following reference from above:

ConfigurationSettings.AppSettings(“sqlConn”)

will not work in C#, in C# this denotes a method, but you are looking for a property. so you use this syntax, which is almost the same…

ConfigurationSettings.AppSettings[“sqlConn”]

just replace the () with and you are set… :slight_smile:

<!-- Web.Config Configuration File –>

<configuration>
<system.web>
<customErrors mode=“RemoteOnly” defaultRedirect=“mycustompage.htm”/>
</system.web>
</configuration>

I am having the same problem, does anyone know how to fix it?

Nice article; simple, but very helpful and easy to follow/understand.

Great article, perfect for the beginner.

<add key=“myKey” value=“myValue” />

How can I access myKey from other sections of the config file?

i.e.

<listeners>
<add name=“myListener”
type=“ATraceListener”
initializeData=[here use myKey] />
</listeners>

Is this possible?

thanks

To acess configuration settings from other sections use “ConfigurationSettings.GetConfig” method. Check it out at MSDN library.

ConfigurationSettings.AppSettings(“sqlConn”)

maybe a typo

ConfigurationSettings.AppSettings[“sqlConn”]

what exactly the difference between
runtime data updation by xml and sql

This article covers the features beautifully in a simple language.

Not a great article. Just setting the custom errors to remote only is not sufficient. Out of the thousands, only a handful have actually implemented proper projects before they write.

For completeness, please be aware that whilst IIS does not need to restart after a modification to a web.config file, the application will restart.

All existing in process session information will be lost.

Nice article though!

This is a good, clear article. I wish the Microsoft books were written this well. It only covers the basics, but it’s helpful for beginners like me.

Just one criticism: there’s no language specified for the example line ‘ConfigurationSettings.AppSettings(“sqlConn”)’. This is a collection, so in C# it needs square brackets. Round brackets in VB. There is also a method for this task, e.g. AppSettingsReader.GetValue(“sqlConn”), so it could cause some confusion.

For configuration of the user sections I use IDM.Net Config Manager located on:
http://idmnetcontrols.com whitout problems.

This article was exactly what I needed - thanks.

For those of us (me) who need everything qualified with it’s namespace:

System.Configuration.ConfigurationSettings.AppSettings[“sqlConn”]