Showing posts with label CreateWebHostBuilder. Show all posts
Showing posts with label CreateWebHostBuilder. Show all posts

Sunday, February 10, 2019

Asp.Net Core Host and Logging Configuration

A simple Asp.Net core application contains a Startup.cs file and a Program.cs file. We saw that the Startup file is used to define the execution pipeline to process Http requests and to inject services. In this post we shall see about the role of Program.cs file.

The Program.cs file in an Asp.Net core application contains logic to define the host configuration and logging configuration. It has the public static void Main() method which is the entry point of the application.

The Main() method calls CreateWebHostBuilder, which in-turn calls WebHost.CreateDefaultBuilder, this method performs the following tasks under the hood.