If we had created a new blank project (EMPTY template) of ASP.NET Core in VS 2015, we see the following structure at the start. Here you can see a couple of things like wwwroot, Dependencies, Startup class and project.json and also you  see some other things like “References” and “Properties” these are the common parts of the .NET application.

 

 global.json

The file allows selection of the .NET Core tools version being used through the sdk property. The version (and optionally run time and architecture) are important because your computer have multiple versions of dnx.exe (.NET Execution Environment). 

 

wwwroot

ASP.NET Core has a new Feature for maintaining wwwroot folder where we put our static contents and libraries so that they are accessible right from the root of the project like HTML files, CSS , image files, and JavaScript files which are sent to the users’ browsers should be stored inside the wwwroot folder.

 Dependencies

There is a special folder called Dependencies which does not present physically but categorically shows the project dependency packages added in the project. Dependencies section is used to manage Bower and NPM tooling packages dependencies in your project. For example, Bower for client-side packages with their dependencies (i.e. jQuery, Bootstrap, Angular). Bower has bower.json file which contains all the packages and dependencies that have installed. So Bower and NPM dependencies appear here in this section. 

 Program.cs class

Program.cs file is the main entry point of our application. As per below code (inside the program.cs), you can see that this class contains a Main() method which looks quite familiar with that you have been seeing in C# Console Apps. This class is used to initiate, build, run the server (IIS and Kestrel) and host the  application. 

 project.json

The first file of our project is project.json. All top level dependencies and libraries that are used by the application are listed in project.json. The project.json file maintains a list of packages used in a project, known as a package reference format.

 Startup.cs Class

The startup class is helpful to define the request handling pipeline and configure the Services required by the app. It has 2 methods ConfigureServices() and Configure(). This class basically is used to configure middle-wares on the request pipeline. The Startup class(Startup.cs) is where application pipeline is configured for request processing.

Web.config

In the previous versions, everything is handled by Web.Config but in ASP.NET Core, we don’t know about Web configure file and the only purpose it gives the instruction to iis for what should be done and it receives the http request.

What do you think?

I hope you have overview about ASP .NET Core Layout/structure of the Application. I would like to have feedback from my posts readers. Your valuable feedback, question, or comments about this article are always welcome.