Skip to Main Content
ASP.NET 4 24-Hour Trainer
book

ASP.NET 4 24-Hour Trainer

by Toi B. Wright
July 2010
Beginner content levelBeginner
552 pages
10h 14m
English
Wrox
Content preview from ASP.NET 4 24-Hour Trainer

Chapter 5. Configuring Your Web Application

Configuration files are used to define Profile properties, store connection strings, configure debugging, define default error pages, and store a host of other settings that control how ASP.NET applications behave. Their primary purpose is to store the settings that you do not want to store in your compiled code.

In this lesson you learn how to configure your web application. I cover the hierarchical nature of web configuration files, how to use the ASP.NET Web site Administration Tool, and how to read a web configuration file programmatically.

WEB CONFIGURATION FILES

At the application level your web configuration is stored in the root folder in a file called web.config. This is an empty web.config file:

<?xml version="1.0"?>
<configuration>
</configuration>

As you can see, the web.config file is an XML text file with a root element of <configuration>.

ASP.NET uses a system of configuration files that is hierarchical. At the top of the hierarchy is the machine.config file. The machine.config file is located in the following folder:

C:\Windows\Microsoft.NET\Framework\v4.0.21006\Config

The machine.config file contains hundreds of settings. The settings in the machine.config file are inherited by all of the applications on the machine that use the .NET Framework. This includes both web applications and other types of applications.

In the same folder as the machine.config file is a web.config file. The web.config file contains settings related to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 4 24-Hour Trainer

ASP.NET 4 24-Hour Trainer

Toi B. Wright
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9780470596913Purchase bookExamplesErrata