Sunday, January 13, 2013

ASP.NET Application Directories


Every web application should have a well-planned directory structure. For example, you’ll probably want to store images in a separate folder from where you store your web pages. Or you might want to put public ASP.NET pages in one folder and restricted ones in another so you can apply different security settings based on the directory. Along with the directories you create, ASP.NET also uses a few specialized subdirectories, which it recognizes by name. Keep in mind that you won’t see all these directories in a typical application. Visual Studio will prompt you to create them as needed.


Bin 
Contains all the compiled .NET components (DLLs) that the ASP.NET web application uses. For example, if you develop a custom component for accessing a database, you’ll place the component here. ASP.NET will automatically detect the assembly, and any page in the web application will be able to use it. This seamless deployment model is far easier than working with traditional COM components, 
which must be registered before they can be used (and often reregistered when they change).

App_Code 
Contains source code files that are dynamically compiled for use in your application. You can use this directory in a similar way as the Bin directory; the only difference is that you place source code files here instead of compiled assemblies.

App_GlobalResources 
Stores global resources that are accessible to every page in the web application. This directory is used in localization scenarios, when you need to have a website in more than one language.

App_LocalResources
Serves the same purpose as App_GlobalResources, except these resources are accessible to a specific page only.

App_WebReferences 
Stores references to web services that the web application uses.

App_Data 
Stores data, including SQL Server 2005 Express Edition database files and XML files. Of course, you’re free to store data files in other directories.

App_Themes 
Stores the themes that are used by your web application.

No comments:
Write comments
Recommended Posts × +