1. Bin folder
The bin folder contains the deployable assembly required by the application for controls, components, or any other code to be referenced. Any. DLL files in this directory are automatically linked to the application.
2. app_browser folder
This optional folder contains the. Browser file .. The Browser file describes the features and functions of browsers (whether mobile devices or desktop browsers.
3. app_code folder
The app_code folder is located in the root directory of the Web application. It stores all class files that should be dynamically compiled as part of the application. These class files are automatically linked to the application without adding any explicit commands or declarations on the page to create dependencies. The class files placed in the app_code folder can contain any identifiable ASP.. NET components-custom controls, helper classes, build providers, business classes, custom providers, HTTP handlers, and so on.
Note that during development, changes to the app_code folder will cause the entire application to be re-compiled. This may be undesirable and time-consuming for large projects. To this end, we encourage you to modularize the code into different class libraries and organize the code according to the logically related class sets. Most of the helper classes dedicated to applications should be placed in the app_code folder.
All class files stored in the app_code folder should use the same language. If a class file is written in two or more languages, you must create subdirectories in a specific language to contain classes written in each language. Once these class files are organized by language, you must add a setting for each subdirectory in the web. config file:
<Compilation>
<Codesubdirectories>
<Add directoryname = "vbfolder"/>
</Codesubdirectories>
</Compilation>
It is important that subdirectories in specific languages should be registered in the web. config file. Otherwise, all files in the app_code folder will be compiled into a separate assembly no matter which folder they belong. The preceding configuration script describes the situation where all C # files are stored in the root directory of the app_code folder, and several Visual Basic. Net files are moved to the vbfolder directory. If the directory mentioned in the <codesubdirectories> section does not exist, a compilation error is reported.
Files in the app_code root folder are compiled into the app_code_xxx.dll assembly, where XXX is a random character sequence. The file in a given subdirectory will be compiled into a dynamically created Assembly named app_subcode_xxx_yyy.dll. xxx indicates the subdirectory name, while YYY indicates a random character sequence. The <codesubdirectories> section is valid only when the web. config file in the application root directory is set.
Place an assemblyinfo. CS file in the app_code directory or any other sub-directories to create a strongly-named assembly. Obviously, if the folder contains the Visual Basic. Net file, the assemblyinfo. VB file will be used. The assembly configuration file can reference A. SNK file to save the key with a strong name.
Note: To set a strong name for an assembly, you must first obtain a public/private key pair. You can obtain such a key pair by using the strong name (strong name1_tool (sn.exe. The strong name tool is one of the SDK binary files that we can find in the. NET Framework installation path. A key pair file usually has a. SNK extension. You can save the file to an application folder and reference it in the assemblyinfo. CS file, as shown below:
[Assembly: assemblykeyfileattribute (@ "yourkeypair. SNK")]
Note that Visual Basic. NET is used to find the key file in the directory containing Visual Studio solution, while the C # compiler searches for the key file in the directory containing the binary file. Therefore, we can use this attribute to adjust the path we are using or place the key file in a suitable folder.
In any subsequent re-generation, the Assembly name will change. At the same time, when the old appdomain request ends, the old assembly will be deleted.
The app_code Folder does not only contain class files. In particular, it can contain and can automatically handle XSD files that represent the data architecture. When you add an XSD file to this folder, the compiler parses it into a dataset class with a type and adds it to the application scope. In ASP. NET 1. X, this job is directed by Visual Studio .netand completed by a command line program (xsd.exe.
Note: When registering a component (for example, a custom server control or a custom HTTP handler) using the web. config file, you must specify the Assembly name that contains the code. If the component is defined in the app_code folder, what name should be used to indicate the assembly? In this case, you only need to ignore the assembly information and specify the complete class name. If no collation set is specified, the ASP. NET runtime attempts to load the class from any mounted assembly, including the Assembly dynamically created for the app_code folder.
4. app_data folder
The app_data folder should contain the local data storage of the application. It usually contains data storage in the form of files (such as Microsoft Access or Microsoft SQL Server express database, XML files, text files, and any other files supported by the application. The content of this folder cannot be processed by ASP. NET. This folder is the default location for ASP. NET providers to store their own data.
Note: by default, ASP. NET accounts are granted full access to folders. If you happen to change your ASP. NET account, make sure that the new account is granted read/write access to the folder.
5. app_globalresources folder
6. app_localresources folder
7. app_themes folder
The app_themes folder defines the topic for the ASP. NET control. The topic contains a folder in the app_themes folder. According to the definition, a topic is a group of files with style information. The file content in the theme folder is compiled to generate a class, which is called by the page to set the theme control style programmatically.
The app_themes folder lists the local topics of the application. The application can also inherit the global themes defined in the following folders:
% WINDOWS % \ Microsoft. NET \ framework \ [version] \ ASP. netclientfiles \ themes
From the compilation perspective, there is no difference between a global topic and a local topic. If a topic with a given name exists both the local topic of the application and the global topic of the server machine, the local topic is preferred.
8. app_webreferences folder
In Visual Studio. NET 2003, an ASP. NET application that needs to access web services will obtain the corresponding. WSDL file through the "add web reference" dialog box. The Web Service Description Language (WSDL) Document of web services is not enough for using web services from pages. The ASP. NET page is eventually a Managed class and needs to communicate with another Managed class. Therefore, a Web Service is encapsulated by a proxy class. This proxy class is created by visual studiousing the command line tool wsdl.exe service. This proxy class should include as many methods as possible as the web method of the web service provider, and it combines any custom data type defined by the public interface of the web service.
Developers do not have to pay a lot for this operation. However, developers obviously need to rely on Visual Studio to generate proxy classes. Isn't it easier and easier to directly place the. WSDL file somewhere in the application's directory tree and let ASP. NET handle other tasks? This is exactly what the app_webreferences folder is going to do.
It identifies the. WSDL files used to describe the bound web service and generates runtime proxy classes so that ASP. NET pages can place type-Safe Web service calls. The app_webreferences folder can contain subfolders. The name of the sub-Folder drives the namespace of the proxy class obtained at the end, while the WSDL file defines the class name. For example, the samples. WSDL file and the prosaspnet20 sub-folder will create a proxy class called proaspnet#samples. The Assembly created in this dynamic state is called app_webreferences.xxx.dll, where XXX is a random character sequence.
Folder name
File Type
Note
Bin
. Dll
Contains any pre-generated assembly required by the application
App_browsers
. Browser
Contains the browser definition file specific to the application. ASP. NET uses it to identify various browsers and determine their functions
App_code
. CS,. VB,. XSD, custom file type
Contains the source files of classes compiled as part of the application. When the page is requested, ASP. NET compiles the code in this folder. The code in this folder is automatically referenced in the Application
App_data
. Mdb,. MDF,. xml
Contains Microsoft Office Access and SQL express files and XML files or other data storage
App_globalresources
. Resx
Resource files included in the localized application for programming
App_localresources
. Resx
Resource files containing page ranges
App_themes
. Skin,. CSS,. XSL, and ancillary files
Contains a set of files that define the appearance of ASP. NET pages and controls
App_webreferences
. WSDL
Contains the WSDL file used to generate the proxy class and other files related to the use of web services in the application.