ASP.NET, App_Code, App_Data and so the role of the folder

ASP.NET, App_Code, App_Data and so the role of the folder

1. Bin folder
Bin folder contains the necessary application for the controls, components, or need to reference any other code can be deployed assembly. The existence of any directory. Dll file will automatically link to the application.

2. App_Browser folder

The optional folder contains. Browser file. . Browser file describing the browser (either mobile device browser, or a desktop browser) features and functions.

3. App_Code folder

App_Code folder, just in the Web application root directory, which stores all part of the application should be as dynamic compiled class files. These class files automatically link to the application, without requiring the page to add any explicit directive or statement to create dependency. App_Code folder to place the class file can contain any identifiable ASP.NET components - custom controls, auxiliary class, build provider, business class, custom provider, HTTP handling procedures.

Note that during development, changes to the App_Code folder will cause the entire application to recompile. For large projects, this may not be popular, and very time-consuming. To this end, encourage modular code for processing to a different class library, according to logically organize a collection of related classes. Application-specific helper classes should be placed mostly in the App_Code folder.

App_Code folder, all the class files should be stored using the same language. If the class files written using two or more languages, you must create a language-specific subdirectory, to include the class with each language. Once these types of documents depending on the language organization, we must in the web.config file, add a subdirectory for each set:



<add directoryName="VBFolder" />

</ CodeSubDirectories>

</ Compilation>

Importantly, the specific language subdirectories should be registered in the web.config file, otherwise, no matter which folder they belong to, App_Code folder of all files will be compiled into a single assembly. The configuration script describes such a situation in which all the C # files are placed in App_Code folder in the root directory, while the number of Visual Basic
. NET class file into VBFolder directory. If <codeSubDirectories> section mentioned directory does not exist, will receive a compile error.

App_Code root folder of the files are compiled into App_Code_xxx.dll assembly, where xxx is a randomly generated sequence of characters. A given subdirectory in the file will be compiled into a dynamic created called App_SubCode_xxx_yyy.dll assembly instructions which subdirectory the name of xxx, and yyy is a random sequence of characters. Only in the application root directory in the web.config file was set, <codeSubDirectories> section to be effective.

In the App_Code directory or any other place a subdirectory assemblyinfo.cs file, you can create a strong named assembly. Obviously, if the folder contains the Visual Basic. NET file, then uses
assemblyinfo.vb file. Assembly can refer to a configuration file. Snk file to save the strong name key.

Attention to an assembly to set a strong name, you must first obtain a public / private key pair. By using a strong name (Strong Name) tools (sn.exe), get a key pair. Strong name tool is we can. NET Framework installation path to one found in SDK binary. Key pair files usually have a. Snk extension. Can save the file to an application folder, and file references in the assemblyinfo.cs it
As follows:

[Assembly: AssemblyKeyFileAttribute (@ "yourKeyPair.snk")]

Note, Visual Basic. NET is a Visual Studio Solution that contains the directory to find key documents
The C # compiler in the directory that contains the binary search for key documents. Accordingly know that, with this attribute to adjust our use of the path, or the key file in the appropriate folder.

In any subsequent re-generation, the assembly name will change. Meanwhile, the old AppDomain request an end to remove the old assembly.

App_Code folder not only contains the class files. In particular, it can contain and can automatically handle the data structure on behalf of
XSD file. To an XSD file to the folder, the compiler will it resolve into a type
DataSet class, and add it to the application scope. In ASP.NET 1.x, this work by the Visual
Studio. NET wizard, use a command line utility (xsd.exe) completed.

Note that using the web.config file to register a component (for example, a custom server control or a custom HTTP handler), it is usually asked to specify the assembly that contains the code name. If the component definition
In the App_Code folder, you should use what name to indicate the assembly? In this case, just ignore the assembly information, and provides for the full class name can be. If you do not require any assembly, the ASP.NET runtime will try to load the program from any kind of concentrated load, including the App_Code folder dynamically created assembly.

4. App_Data folder

App_Data folder should contain the application's local data storage. It is usually a document (such as Microsoft
Access or Microsoft SQL Server Express databases, XML files, text files and application support of any other document) that contains the form of data storage. The contents of a folder not help ASP.NET processing. The folder is ASP.NET
Provider of data storage itself the default location.

Note that the default ASP.NET account is granted full access to the folder. If you happen to change
ASP.NET account, we must ensure that the new account is granted the folder read / write access.

5. App_GlobalResources folder

6. App_LocalResources folder

7. App_Themes folder

App_Themes folder for the ASP.NET controls custom theme. Topics included in the App_Themes folder in a folder. By definition, a theme is a set of documents with the style information. Theme file in the folder content is compiled to produce a class, but such is the page called to programmatically set the theme of control style.

App_Themes application folder listed in the local theme. Applications can also be defined folder inherit the following global themes:

% WINDOWS% "Microsoft.NET" Framework "[version]" ASP.NETClientFiles "Themes

From the compiler point of view, the overall situation is no different themes and local themes. If the theme of a given name, there was not only the application's local theme, then there is the overall theme of the server machine, then the local themes prevail.

8. App_WebReferences folder

In Visual Studio. NET 2003, a need to access Web services, ASP.NET applications, through the "Add Web Reference" dialog box was appropriate. Wsdl file. Web services, WSDL (Web Service Description
Language) document, for the use of Web services from the page is not enough. ASP.NET page is ultimately a managed class, and the need to communicate with another managed class. Therefore, Web services, packaged by a proxy class. The proxy class is a Visual
Studio using the command-line tool wsdl.exe service created. The proxy class contains as much as possible the Web Methods Web service methods as much, and it combines the Web service's public interface definition of any custom data types.

This operation does not require developers to pay a high price. However, the developers obviously depends on the Visual Studio to generate the proxy class. If you can directly. Wsdl file on the application's directory tree somewhere, and let ASP.NET handle the rest of the task is not to be easier, more simple? This is precisely what App_WebReferences folders do.

It is to identify those used to describe the binding of Web services. Wsdl file, and run-time generated proxy class, so that ASP.NET pages can be type-safe way to place a call on Web services. App_WebReferences folder can contain subfolders. Subfolder name driver get in the end the proxy class namespace, and WSDL file defines the class name. For example, samples.wsdl files and ProsAspNet20 will create a subfolder called ProAspNet20.Samples the proxy class. The dynamic creation of the assembly is called, where xxx is a random sequence of characters.

Note the folder name file type

. Dll
Include the application of any pre-generated the required assembly

. Browser
Contains application-specific browser definition files, ASP.NET use it to identify the various browsers and determine their functions

. Cs,. Vb,. Xsd, custom file types include, as part of the application source files compiled class. When the page is requested, ASP.NET compiles the code folder. The code in that folder automatically in the application cited

. Mdb,. Mdf,. Xml
Includes Microsoft Office Access and SQL Express files and XML files or other data storage

. Resx
Included in the localization of the application to use the resource file programmatically

. Resx
The scope of the resource file that contains the page

. Skin,. CSS,. Xsl, subsidiary file contains a set of ASP.NET pages and controls define the appearance of documents

. Wsdl

分类:DotNet 时间:2010-05-06 人气:251
blog comments powered by Disqus


  • weblogic root directory as an application in the default directory (zz) 2010-08-11

    Use the root directory as the default directory, need to create a new project can be called index, and then the WEB-INF directory below to create a new weblogic.xml, content <! - <br /> <br /> Code highlighting produced by Actipro CodeHighl

  • Struts2 Action reads web folder under the root directory of the file Uploadfile 2011-04-18

    web root directory: 109UPload 109UPload |------ Uploadfile | |------ 109.txt |------ WEB-INF Action class to read the files within the folder Uploadfile 109.txt methods are: Method One: public class SaveAction implements Action{ public static String

  • VFS + SFTP root directory redirection 2010-06-09

    In order to project requirements SFTP helpless on the floor of the Apache in the VFS. Online introduction to the VFS few official DOC can be ignored. Found no SFTP access to the root directory where to begin debugging VFS. Finally resolved the issue

  • IXWebhosting use workpress, how to redirect to the root directory 2010-05-30

    I searched a number of articles , through the wordpress directory ". htaccess" file and "index.php" file to the site root directory and then modify the index.php in the link to point to. But do not produce results. After repeatedly try

  • Set the Apache HTTP Server document root directory (DocumentRoot) 2010-09-29

    Set the Apache HTTP Server document root directory (DocumentRoot). Apache is installed, the system will set a default document root directory. If you think there is the default directory the page is not convenient, think we should also set up a direc

  • html in the link url to the root directory, or the parent directory 2010-07-19

    1. With the site's domain name on it, such as: "../../../ index.htm "into: 2. With the code: local_path=Request.SeverVariables("local_addr") path=local_path & "/index.htm" With an absolute path from th

  • [Reprinted] WordPress root directory file 2010-09-19 E6% A0% B9% E7% 9B% AE% E5% BD% 95% E6% 96% 87% E4% BB% B6 / WordPress root directory (Root) index.php: WordPress core index file, that blog output file. license.txt: WordPress GPL license file. my-hacks.php:

  • [Reproduced] WordPress root directory file 2010-09-19 E6% A0% B9% E7% 9B% AE% E5% BD% 95% E6% 96% 87% E4% BB% B6 / WordPress root directory (Root) index.php: WordPress core index file, that blog output file. license.txt: WordPress GPL license file. my-hacks.php:

  • Absolute path to the root directory of the project 2010-12-03

    The PHP system development, the introduction of the file is a very troublesome thing, because the document references will appear nested, so in this document by reference is correct, is not referenced in another document has come. php include files a

  • win7 apache virtual host can not be listed under the root directory of the file 2011-04-19

    window7 configure virtual hosts can not list the root directory file, the solution: Open the directory listing functions: <Directory /path/to/directory> Options + Indexes </ Directory> Close out directory features: <Directory /path/to/direc

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C), All Rights Reserved. 版权所有 闽ICP备15018612号

processed in 0.053 (s). 13 q(s)