Let’s create our first ASP.NET Core MVC Web Application. We assume that we already have Visual Studio 2015 Update 3 and .NET Core 1.0.0 - VS 2015 Tooling Preview 2. If you have not installed .NET Core yet, I may recommend you to follow our initial discussion how to install .NET Core 1.0. Alternatively, you can follow Microsoft Official Site directly.

Create a new Solution

Add a new ASP.NET Core Project in Solution

Run Application in Debug Mode

ASP.NET Core 1.0 MVC Project Structure Overview

When we analyze created project, we can divide the project into following major areas-

Configuration FilesProperties

Properties section contains launchSettings.json file, which has project settings. Although it can be edited directly, it is generally edited by other interfaces like the project properties.

Configuration FilesProperties

References

References section contains all DLL references added to project. Visual Studio 2015 shows the added references in the groups. For this template, Visual Studio adds .NET Core Application related DLLs.

References

We can add new references directly or through NuGet Packages.

Wwwroot

wwwroot is a special folder, which contains all the static resources like css, images, JavaScript and included libraries. Visual Studio Template uses wwwroot name by default, but we can change it, as per the requirements.

Wwwroot

Dependencies

Dependencies section contains the list of third part dependencies added to the project through Bower. By default, this template adds bootstrap, jquery, jquery-validation and jquery-validation-unobtrusive.

Dependencies

We can add new bower through Manage Bower Packages.

Controllers

Controllers folder contains the controllers added to an application. It is not necessary to add the controllers to this folder or to create this folder, but it is one of the practices to add the controllers to this folder or its subfolders. This templates add HomeController by default with Index, About and Contact action methods.

Controllers

Views

Views folder contains views in 3 categories, which are-

Controller Views

All the views related to a controller have views in a folder named to that controller. This example Home folder contains views for each action method of HomeController.

Shared Views

Shared views folder contains: _Layout and Error view. _Layout view contains layout of an Application and in term of ASP.NET, it replaces Master Page. Error view contains the implementation of an error page, which is displayed to the end user in case of any error.

Special Views

While there are two special views in this template: _ViewImports and _ViewStart. _ViewImports contains the list of imports for all the views. ViewStart contains the generic page initializations like layout globally.

Views

Program.cs

Program.cs contains the Main method, which is the starting point of an Application. It initializes WebHostBuilder instance and starts the host environment. We can set the Web Server related configurations in this area. We will have the complete detailed discussion on this item separately.

Program.cs

Startup.cs

Startup.cs contains the main implementation for Environment Startup. This class not only initializes the basic environment configurations and request pipeline but also other features like logging, error page and routing. We will have a complete detailed discussion on this item separately.

Startup.cs

Configuration Files

This template creates different configuration files of .config and .json type at the root of the project-

We can also use ini files, environment variables, command line arguments and even custom configuration provider. We will have a complete detailed discussion on this item separately.

Configuration Files

Sample Source Code

We have placed sample code for this session in "Welcome to ASP.NET Core_Code.zip" in CodePlex repository.