add Element for codeSubDirectories for compilation (ASP.NET Settings Schema)
Adds a subdirectory to the collection of subdirectories that contain files to compile at run time.
This element is new in the .NET Framework version 2.0.
<add
directoryName="assembly sub-directory, relative to \App_Code"
/>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute | Description |
---|---|
directoryName |
Required String attribute. Defines the name of a subdirectory that contains the files to compile at run time. Subdirectory names are relative to the App_Code directory. This is the collection key. |
Child Elements
None.
Parent Elements
Element | Description |
---|---|
configuration |
Specifies the root element in every configuration file that is used by the common language runtime and the .NET Framework applications. |
system.web |
Specifies the root element for the ASP.NET configuration section. |
compilation |
Configures all compilation settings that ASP.NET uses to compile applications. |
codeSubDirectories |
Defines an ordered collection of subdirectories containing files to compile at run time. |
Remarks
The add element adds a subdirectory to the collection of subdirectories that contain files to compile at run time. The collection is contained in the codeSubDirectories element.
The codeSubDirectories element defines an ordered collection of subdirectories that contains files to compile at run time.
Subdirectory names are relative to the App_Code directory.
The build order is inferred from the top-down order of the codeSubDirectories collection. The App_Code directory is built last. However, there are no build order dependencies, which means that the build order is not significant.
Default Configuration
There is no default codeSubDirectories element configured for ASP.NET.
Example
The following code example demonstrates how to define an assembly directory location.
<configuration>
<system.web>
<compilation>
<codeSubDirectories>
<add directoryName="/mysite/code/mySubDir"/>
</codeSubDirectories>
</compilation>
</system.web>
</configuration>
Element Information
Configuration section handler |
|
Configuration member |
|
Configurable locations |
Machine.config Root-level Web.config Application-level Web.config Virtual or physical directory–level Web.config |
Requirements |
Microsoft Internet Information Services (IIS) version 5.0, 5.1, or 6.0 The .NET Framework version 2.0 Microsoft Visual Studio 2003 or Visual Studio 2005 |
See Also
Tasks
How to: Configure Specific Directories Using Location Settings
How to: Lock ASP.NET Configuration Settings
Reference
buildProviders Element for compilation (ASP.NET Settings Schema)
clear Element for codeSubDirectories for compilation (ASP.NET Settings Schema)
remove Element for codeSubDirectories for compilation (ASP.NET Settings Schema)
configuration Element (General Settings Schema)
system.web Element (ASP.NET Settings Schema)
compilation Element (ASP.NET Settings Schema)
System.Configuration
System.Web.Configuration
CompilationSection
Add
Concepts
ASP.NET Compilation Model
ASP.NET Web Page Code Model
ASP.NET Web Site Precompilation Overview
ASP.NET Configuration File Hierarchy and Inheritance
Securing ASP.NET Configuration
ASP.NET Configuration Scenarios
Other Resources
General Configuration Settings (ASP.NET)
ASP.NET Configuration Settings
Configuring ASP.NET Applications
ASP.NET Configuration Files
ASP.NET Configuration API