Introduction
This article explains the basics of ASP.NET Core using Visual Studio 2017 and easy ways to create ASP.NET Core applications.
.NET Core
.NET Core is an open source and cross-platform subset of the full .NET framework and it supports Windows, Linux, and macOS. It is used to develop Windows applications as well as Console applications, and it only supports single app model.
ASP.NET Core
ASP.NET Core is a new generation of ASP.NET. It is used to develop web applications with better and improved features. ASP.NET Core is free, open source, and cross-platform development framework. We can develop and run ASP.NET Core apps on Windows, Mac, and Linux. ASP.NET Core is not based on System.Web.dll, it is fully different. There are three important .NET Core tools as follows.
- Visual Studio 2017
- Visual Studio Code
- Command Line Interface.
We can install Visual Studio 2017 in very easy way following the steps mentioned in the article Install Visual Studio 2017.
Simple example and overview of ASP.NET Core Application
We are using Visual Studio 2017 for developing ASP.NET Core application. Open Visual Studio, open New Project >> “ASP.NET Core Web Application (.NET Core)”.

We selected “ASP.NET Core 1.1” and then Empty template. An empty project template is selected for creating an ASP.NET Core application. This template does not have any content in it.

Solution Explorer
We can see all the folders and files in Solution Explorer. These files are different as compared to the normal ASP.NET files.

Dependencies are like references in ASP.NET Core. If we expand the dependencies, we can see the NuGet and SDK. ASP.NET Core is a full NuGet package and it is not based on System.Web.dll.
We can see the SDK and inside SDK, we can see the “Microsoft.NETCore.App”. It is a target to .NET Core framework.

All the NuGet packages are added as references. Right click your project in Solution Explorer and go to Edit DemoASP.NET Core.csproj.

Now, DemoASP.NET.Core.csproj file will open. We can see the package reference in that file which looks like the below screenshot.

If we remove any one of the package references from DemoASP.NET.Core.csproj, it will be removed from NuGet in Solution Explorer too.

Program.cs
Program class is the main part of the ASP.NET Core. It contains static method and also beginning pointing of the application. This main method creates a host, builds a host, and runs the host.
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Threading.Tasks;
- using Microsoft.AspNetCore.Hosting;
- namespace DemoASP.NETCore
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- //Create host using WebHostBuilder class
- var host = new WebHostBuilder()
- .UseKestrel()
- .UseContentRoot(Directory.GetCurrentDirectory())
- .UseIISIntegration()
- .UseStartup<Startup>()
- .UseApplicationInsights()
- .Build();
- host.Run();
- }
- }
- }
Kestrel
Kestrel is a cross-platform web server for ASP.NET Core. Kestrel is the web server that is included by default in ASP.NET Core project templates. It supports HTTPS.


Pirzada JeelaniPosted Apr 19, 2018, 1:31 PM
Very simple and self explanatory. Thanks Man
DeepanPosted Aug 19, 2017, 10:20 AM
Nice job. New words came across. useful article
Hariharan KrishnamoorthiPosted Aug 17, 2017, 10:49 AM
Nice job Vignesh. Expecting more articles from you... :)