Click here to Skip to main content
12,997,914 members (55,800 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Revisions
Add your own
alternative version


95 bookmarked
Posted 3 Feb 2013

Deep Dive into ASP.NET MVC 4 - Part [2] - Project Items

, 4 Feb 2013
Rate this:
Please Sign up or sign in to vote.
ASP.NET MVC project folder structure
This is an old version of the currently published article.

Table Of Contents


ASP.NET MVC relies on Convention over Configuration. If you want to make your website development easy and productive it's important to understand the Project Items or Application Folder Structure of an ASP.NET MVC Application. In this article I will explain the Project Items of an Internet Application Template of ASP.NET MVC 4. If you are new to MVC then you might want to check my previous article on Introduction to MVC 4.

I hope you will enjoy this article.I have put my time and efforts on all of my articles, Please don't forget to mark your votes, suggestions and feedback to improve the quality of this and upcoming articles.

Overview – Project Items

While creating a new application, as of now there are six different Project Templates available with ASP.NET MVC 4 . If you have not yet explored all the project templates with MVC 4, please check my MVC 4 - Introduction article.

All project templates gives a common structure, some of the templates are having some different files and or folders for specific purpose. The below given screen-shot is of Internet Application Template of MVC 4.

It’s very important to know the structure of application and file/folder conventions. In this article I’m going to explain all the above project items from a beginner’s perspective. For getting a clear picture I have added more files and folders to the newly created solution. Some of the folders are not exactly useful for ASP.NET MVC but still I have added that folders too so that a new comer also can understand which is used for what. Lets explore the Files/Folders from the above Solution (InternetMVC4App).

Note: The attached files doesn't have any functionalities implemented, it's just the application used for this article.

Solution File

Solution is a grouping of one or more projects that work together to create an application. In a simple way we can say a solution is a structure for organizing projects in Visual Studio.

Solution File

Read more from MSDN.

Project File

The project file is an XML document that contains all the information and instructions that MSBuild needs in-order to build your project, like the contents to include, the platform requirements, versioning information, web server or database server settings, and the tasks that must be performed. Every Visual Studio project includes an MSBuild project file, with a file extension that reflects the type of project—for example, a C# project (.csproj), a Visual Basic.NET project (.vbproj), or a database project (.dbproj).

Read more from

Properties Folder

When talking about the "Properties" Folder, the first thing I wanted to mention is the AppDesignerFolder entry in project file in our case .csproj file.

Properties folder is the first folder in the project node. If you expand the "Properties" Folder, you can see a file named AssemblyInfo.cs.

The AssemblyInfo.cs contains the details related to assembly version information and other information about the assembly that will be displayed in detail section of properties window of the assembly. The content of AssemblyInfo.cs is given below,

The below given screenshot shows the assembly version details in the 'properties' window of assembly file.

If you double-click on this folder then it will show Project Properties page instead of expanding it. Click here to view larger image

If required, the properties folder name can be renamed but we need to update the .csproj file accordingly. If you are deleting the file AssemblyInfo.cs or folder Properties then the assembly details won’t be available in the details tab. The below given screenshot shows the assembly version details after deleting the folder or file.

Assembly Properties, No Version Number

The above image shows default values for assembly details.

Reference Folder

These are assemblies that have been referenced in our current project. If you want to add any assembly reference or any service (WCF / Web Service) reference you can add it from here.

To add an assembly reference just right click on the Reference folder and click on the 'Add Reference' menu, please refer the below screenshot.

Once you click on the above (Add Reference) menu then a popup will be shown like below screen, select the required assembly and click on OK.

Add Assembly Reference

If you wanted to add a service reference then click on 'Add Service' menu, once you clicked on 'Add Service ' menu, you will get a screen a screen like below where you can give the service URL,

give the service URL ( you can give .svc or .asmx URL here) if you want to get the old Add Web Service menu then click on 'Advanced' option there you can see the 'Add Web Reference' menu.

After clicking on 'Add Web Reference' menu , now you got the old Web Service screen where you used to give .asmx URL.

Web Service Reference

App_Browsers Folder

App_Browsers folder contains browser definitions ( .browser files). Browser definition files contain definitions for individual browsers. At run time, ASP.NET uses the information in the request header to determine what type of browser has made the request. Then ASP.NET uses .browser files to determine the capabilities of the browser.

Browser definition files were introduced in .NET Framework version 2.0. In earlier versions of the .NET Framework, the browserCaps element was used to define browser definitions in configuration files.

You can find existing browser definition files at


here [VERSION] is the framework version that you have already installed.

If you want to change the definitions of any of these browser definition files, Just copy the appropriate file to our project's App_Browsers folder and modify the definition as per the requirement. The below screen shot shows the content of newly added BrowserFile1.browser file, We can see that it's just an XML file that describes the capabilities of the browser.

Browser Definition File Sample

Read more on Browser Definition File from MSDN.

App_Code Folder

App_Code is used for keeping class files , typed objects etc. Code from the App_Code folder is referenced automatically in our application.The App_Code folder can contain subdirectories of files, which can include class files that in different programming languages (eg:- .cs,.vb).

As per my understanding App_Code is not really meant for Web Application Projects, if we are using App_Code in WAP (Web Application Project) then we need to change the "Build Action" to 'Content' from 'Compile' to work everything as expected, Read more on Shared Code Folders in ASP.NET Web Site Projects

App_Data Folder

To add an ASP.NET Folder you can refer the below screen-shot,

ASP.NET Platform Folders

The folder will be disabled if already that folder is added. You can see that the App_Data is disabled as its already exists in our application.

This folder is meant for keeping data files such as XML, .mdf, .mdb files. In our default MVC template this folder is used to manage membership and role information. If you are using App_Data folder then you can mention the folder as |DataDirectory| (enclosed in pipe symbols) in connection string. |DataDirectory| is a substitution string that indicates the path to the App_Data folder. The files from the App_Data folder are safe as IIS will not process any files from this folder. You can find a sample code of DataDirectory in a project here App_Data in real application.

App_GlobalResources Folder

App_GlobalResource Folder contains resources (.resx and .resources files) that are compiled into assemblies with global scope. Resources in the App_GlobalResources folder are strongly typed and can be accessed programmatically

Read More on Web Page Resource from MSDN

App_LocalResources Folder


App_LocalResources Folder contains resources (.resx and .resources files) that are associated with a specific page, user control, or master page in an application.

Read More on Web Page Resource from MSDN

App_Start Folder

This folder is just a convention and it separates some code from Global.asax,

And also we can avoid touching Global.asax file when using any new nugget packages that needs to use Application_Start from Global.asax


 AuthConfig MVC

AuthConfig.cs files helps us to login with our social networking sites like Facebook, Twitter, Google etc.


 BundleConfig MVC

BundleConfig.cs is used to register bundles used by the Bundling and Minification. The below given image shows how the scripts are adding in the .cshtml file.

 BundleConfig MVC


 FilterConfig MVC

FilerConfig.cs is used to register global MVC filters.


 RouteConfig MVC

Routes are registered in RouteConfig.cs


WebApiConfig.cs is used to register Web API routes.


The main purpose of App_Start and containing files are to move configuration logic from Global.asax to set of static classes in the App_Start directory.

App_Themes Folder

App_Theme folder is used to apply styles/themes to web application. We can have multiple themes created for our application and also if we want we can problematically change the theme of our application. We can apply the theme from the web form or from the web.config file.

App_Themes folder is used in regular ASP.NET but there are other different ways also to implement themes in ASP.NET MVC .

Read more on MSDN

Areas Folder

ASP.NET MVC allows us to partition our web application into smaller parts using "Areas" Areas provide a way to separate a large MVC Web application into smaller functional groupings. An area is effectively an MVC structure inside an application. An application could contain several MVC structures (areas).

You can add an Area to a ASP.NET MVC project as shown below

Adding Area in MVC 4

I have named the area as "Admin" and after clicking on "Add" button a folder created with "Areas" with subfolder "Admin".

Area Name

The created "Area", "Admin" have all the entries/folders/files to work the RazorViewEngine properly

Area - MVC 4

The file "AdminAreaRegistration.cs" auto generated code is given below,

The "AreaRegistration.RegisterAllAreas(); " entry in Global.asax's Application_Start will take the responsibility of registering all the Areas.

Read more from MSDN.

Bin Folder

Normally this folder won’t be listed in solution explorer until you click on ‘Show All’ menu. To get the "Show All" menu click on the Project Menu like below,

Other wise you can also get the menu from the Solution Explorer itself.

The compiled assembly for your MVC application is placed here, along with any referenced assemblies that are not in the GAC. This folder contents are not served by IIS. Click here to the contents of bin folder.

Content Folder

This is where we put our static contents like CSS, Images. This folder is just a convention and it’s not mandatory to put our static files in this folder..

Controllers Folder

This is where we put our controller classes. This folder is just a convention we can create our controller classes any where in the application. MVC will recognize any class that implements the IController interface as a Controller regardless of the location.

Filters Folder

Images Folder

All Images are kept in this folder and this folder is being referenced from the Content\Site.css.

Models Folder

This is where you put your view model and domain model classes. This is a convention and we can define model class anywhere in the project or in different project also.

Scripts Folder

This directory is intended to hold the JavaScript libraries for your application. When we created our application itself Visual Studio added many JavaScript libraries like jQuery, knockout etc. This is just a convention.If we want we can keep this all in other folder also.

Views Folder


This directory holds layouts (master-page in-terms of web forms) and views which are not specific to a single controller.


Views or Partial Views specific to that folder or single controller.


This is not the configuration file for your application. It contains the configuration required to make views work with ASP.NET and prevents views from being served by IIS.

FavIcon File

This is the favicon for our web application.

Global.asax File

This is the global ASP.NET application class. Its code-behind class (Global.asax.cs) is the place to register routing configuration, as well as set up any code to run on application initialization or shutdown, or when unhandled exceptions occur.

Packages.config File

This file is used by NuGet. While creating the project itself the IDE interanlly used NuGet for installing packages. This file is used to track the installed NuGet packages with their respective versions.

Web.config File

Web.config is the main settings and configuration file for an ASP.NET web application


In this article I have explained ASP.NET MVC 4 Project Items from a beginner's perspective. I hope you have enjoyed this article and got some value addition to your knowledge.

I have put my time and efforts on all of my articles, Please don't forget to mark your votes, suggestions and feedback to improve the quality of this and upcoming articles. Thanks for reading.

Prev | Next


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Shemeer NS
Software Developer (Senior)
India India
Technology Specialist | CodeProject MVP | Visual Studio Gallery Contributor | Author | Geek | Netizen | Husband | ChessPlayer

Most of my articles are listed on top 5 of the respective 'Best articles of the month' and some of my articles are published on ASP.NET WebSite's Article of the Day section.

Check my contributions in Visual Studio Gallery and Code Project

Technical Blog:
Twitter :
Google+ :

You may also be interested in...

Comments and Discussions

Discussions posted for the Published version of this article. Posting a message here will take you to the publicly available article in order to continue your conversation in public.
Generalgood Pin
Member 111768238-Dec-14 0:05
memberMember 111768238-Dec-14 0:05 
QuestionVery good article for the beginers Pin
akhildev16-Jun-14 23:27
memberakhildev16-Jun-14 23:27 
QuestionVery helpful article . Pin
sapan sahoo2-Mar-14 20:44
membersapan sahoo2-Mar-14 20:44 
QuestionBig Thanks for your Articles Shemeer! Pin
Bal00018-Jan-14 7:59
memberBal00018-Jan-14 7:59 
GeneralThanks Pin
igkutikov14-Dec-13 12:22
memberigkutikov14-Dec-13 12:22 
QuestionThanking Pin
Eranga S Ranasinghe12-Dec-13 0:29
memberEranga S Ranasinghe12-Dec-13 0:29 
QuestionWonderful Article in short crisp and clear.. Must Read for beginners to avoid confusion Pin
nishant00926-Nov-13 21:45
membernishant00926-Nov-13 21:45 
GeneralVery helpful Pin
yaseenansari23-Oct-13 3:31
memberyaseenansari23-Oct-13 3:31 
GeneralMy vote of 5 Pin
dengkun3911-Sep-13 21:46
memberdengkun3911-Sep-13 21:46 
GeneralMy vote of 5 Pin
dracopql3-Sep-13 11:31
memberdracopql3-Sep-13 11:31 
GeneralMy vote of 5 Pin
Dan Randolph19-Aug-13 12:29
professionalDan Randolph19-Aug-13 12:29 
GeneralRe: My vote of 5 Pin
peddirajulaswamy29-Aug-13 6:53
memberpeddirajulaswamy29-Aug-13 6:53 
QuestionTypo Pin
Member 99616706-Aug-13 18:12
memberMember 99616706-Aug-13 18:12 
GeneralMy vote of 5 Pin
sherin123414-Jul-13 22:08
membersherin123414-Jul-13 22:08 
GeneralMy vote of 4 Pin
ratnakargudipati24-Jun-13 1:46
memberratnakargudipati24-Jun-13 1:46 
Questiongood article Pin
harshal768917-May-13 1:57
memberharshal768917-May-13 1:57 
AnswerRe: good article Pin
Shemeer NS19-May-13 5:03
mvpShemeer NS19-May-13 5:03 
General5, but where are the rest? Pin
Member 798058321-Apr-13 5:16
memberMember 798058321-Apr-13 5:16 
GeneralRe: 5, but where are the rest? Pin
Shemeer NS21-Apr-13 19:18
mvpShemeer NS21-Apr-13 19:18 
GeneralMy vote of 5 Pin
Savalia Manoj M25-Mar-13 3:48
memberSavalia Manoj M25-Mar-13 3:48 
GeneralRe: My vote of 5 Pin
Shemeer NS21-Apr-13 19:10
mvpShemeer NS21-Apr-13 19:10 
GeneralMy vote of 5 Pin
Sudheer Reddy K24-Mar-13 17:26
memberSudheer Reddy K24-Mar-13 17:26 
GeneralRe: My vote of 5 Pin
Shemeer NS21-Apr-13 19:10
mvpShemeer NS21-Apr-13 19:10 
GeneralMy vote of 5 Pin
Kotha Ramesh Babu12-Mar-13 23:25
memberKotha Ramesh Babu12-Mar-13 23:25 
GeneralRe: My vote of 5 Pin
Shemeer NS21-Apr-13 19:09
mvpShemeer NS21-Apr-13 19:09 
QuestionMy vote is 5 Pin
Fabio Galante Mans11-Mar-13 6:21
memberFabio Galante Mans11-Mar-13 6:21 
AnswerRe: My vote is 5 Pin
Shemeer NS21-Apr-13 19:08
mvpShemeer NS21-Apr-13 19:08 
GeneralMy vote of 5 Pin
Humayun Kabir Mamun7-Mar-13 23:43
memberHumayun Kabir Mamun7-Mar-13 23:43 
GeneralRe: My vote of 5 Pin
Shemeer NS21-Apr-13 19:08
mvpShemeer NS21-Apr-13 19:08 
GeneralMy vote of 4 Pin
namrathamahesh6-Feb-13 17:40
membernamrathamahesh6-Feb-13 17:40 
GeneralRe: My vote of 4 Pin
Shemeer NS21-Apr-13 19:08
mvpShemeer NS21-Apr-13 19:08 
GeneralMy vote of 5 Pin
Member 94853246-Feb-13 12:17
memberMember 94853246-Feb-13 12:17 
GeneralRe: My vote of 5 Pin
Shemeer NS21-Apr-13 19:07
mvpShemeer NS21-Apr-13 19:07 
GeneralMy vote of 1 Pin
Dave Kreskowiak6-Feb-13 3:49
mvpDave Kreskowiak6-Feb-13 3:49 
GeneralRe: My vote of 1 Pin
Shemeer NS6-Feb-13 4:26
mvpShemeer NS6-Feb-13 4:26 
QuestionDon't use images for code. Pin
Pete O'Hanlon5-Feb-13 5:42
protectorPete O'Hanlon5-Feb-13 5:42 
AnswerRe: Don't use images for code. Pin
Shemeer NS5-Feb-13 6:55
mvpShemeer NS5-Feb-13 6:55 
GeneralRe: Don't use images for code. Pin
Pete O'Hanlon5-Feb-13 7:01
protectorPete O'Hanlon5-Feb-13 7:01 
GeneralMy vote of 5 Pin
Member 8846964-Feb-13 22:06
memberMember 8846964-Feb-13 22:06 
GeneralRe: My vote of 5 Pin
Shemeer NS21-Apr-13 19:07
mvpShemeer NS21-Apr-13 19:07 
GeneralMy vote of 5 Pin
Hamidnch4-Feb-13 20:34
memberHamidnch4-Feb-13 20:34 
GeneralRe: My vote of 5 Pin
Shemeer NS21-Apr-13 19:07
mvpShemeer NS21-Apr-13 19:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170622.1 | Last Updated 5 Feb 2013
Article Copyright 2013 by Shemeer NS
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid