Online Book Reader

Home Category

Programming Microsoft ASP.NET 4 - Dino Esposito [35]

By Root 5386 0

Contains ciphered data for sections that have been encrypted.

Run-time settings schema; describes the elements that configure assembly binding and run-time behavior such as probing and assembly redirect.

Startup settings schema; contains the elements that specify which version of the common language runtime (CLR) must be used.

Describes the elements that specify trace switches and listeners that collect, store, and route messages.

Network schema; specifies elements to indicate how the .NET Framework connects to the Internet, including the default proxy, authentication modules, and connection parameters.

Settings schema; configures the client and server applications that exploit the .NET Remoting.

Contains configuration settings for Windows Communication Foundation (WCF) services being used by the ASP.NET application.

The ASP.NET-specific configuration section; it contains the elements that control all aspects of the behavior of an ASP.NET application.

Contains elements that configure ASP.NET AJAX capabilities and services and control their behavior.

Specifies settings for the IIS 7 Web server (and newer versions) that configure the host environment for the ASP.NET application.

Because we’re discussing ASP.NET applications, in this chapter I’ll focus primarily on the section, with a look at . I’ll cover later on in Chapter 20, which is dedicated to AJAX programming. Other sections for which you’ll find significant coverage here are and . However, this doesn’t mean that, as an ASP.NET developer, you’ll never be using other sections—most certainly not!

For example, the element defines the sections that will be used to group information in the rest of the document. The element contains user-defined nodes whose structure has been previously defined in the node. You might need to interact with the section if you want to use a custom trace listener that logs its results to an application-defined file.

Another section that is often found in the configuration of ASP.NET applications is . The section is used to store settings about WCF services your ASP.NET application is going to use. Settings typically include binding information (transportation, security, credentials) and endpoint details (URL, contract, operations).

Sections and Section Groups


All sections used in a configuration file must be declared in the initial section. The following code snippet demonstrates how the section is declared in machine.config:

type="System.Web.Configuration.SystemWebSectionGroup, ...">

type="System.Web.Configuration.AuthenticationSection, ..."

allowDefinition="MachineToApplication" />

...

The element has no other role than marking and grouping a few child sections, thus creating a sort of namespace for them. In this way, you can have sections with the same name living under different groups. The

element takes two attributes: name and type. The name attribute denotes the name of the section being declared. The type attribute indicates the name of the managed class that reads and parses the contents of the section from the configuration file. The value of the type attribute is a comma-separated string that includes the class and full name of the assembly that contains it.

The

element also has two optional attributes: allowDefinition and allowLocation. The allowDefinition attribute specifies which configuration files the section can be used in. Feasible values for the allowDefinition attribute are listed in Table 3-2.

Table 3-2. Values for the allowDefinition Attribute

Return Main Page Previous Page Next Page

®Online Book Reader