diff --git a/aspnetcore/fundamentals/index.md b/aspnetcore/fundamentals/index.md index 1618306b73..056d762593 100644 --- a/aspnetcore/fundamentals/index.md +++ b/aspnetcore/fundamentals/index.md @@ -4,17 +4,22 @@ author: rick-anderson description: Discover the foundational concepts for building ASP.NET Core apps. ms.author: riande ms.custom: mvc -ms.date: 08/20/2018 +ms.date: 10/25/2018 uid: fundamentals/index --- # ASP.NET Core fundamentals -An ASP.NET Core app is a console app that creates a web server in its `Main` method: +An ASP.NET Core app is a console app that creates a web server in its `Program.Main` method. The `Main` method is the app's *managed entry point*: ::: moniker range=">= aspnetcore-2.0" [!code-csharp[](index/snapshots/2.x/Program.cs)] +The .NET Core Host: + +* Loads the [.NET Core runtime](https://github.com/dotnet/coreclr). +* Uses the first command-line argument as the path to the managed binary that contains the entry point (`Main`) and begins code execution. + The `Main` method invokes [WebHost.CreateDefaultBuilder](xref:Microsoft.AspNetCore.WebHost.CreateDefaultBuilder*), which follows the [builder pattern](https://wikipedia.org/wiki/Builder_pattern) to create a web host. The builder has methods that define the web server (for example, ) and the startup class (). In the preceding example, the [Kestrel](xref:fundamentals/servers/kestrel) web server is automatically allocated. ASP.NET Core's web host attempts to run on IIS, if available. Other web servers, such as [HTTP.sys](xref:fundamentals/servers/httpsys), can be used by invoking the appropriate extension method. `UseStartup` is explained further in the next section. , the return type of the `WebHost.CreateDefaultBuilder` invocation, provides many optional methods. Some of these methods include `UseHttpSys` for hosting the app in HTTP.sys and for specifying the root content directory. The and methods build the object that hosts the app and begins listening for HTTP requests. @@ -25,6 +30,11 @@ The `Main` method invokes [WebHost.CreateDefaultBuilder](xref:Microsoft.AspNetCo [!code-csharp[](index/snapshots/1.x/Program.cs)] +The .NET Core Host: + +* Loads the [.NET Core runtime](https://github.com/dotnet/coreclr). +* Uses the first command-line argument as the path to the managed binary that contains the entry point (`Main`) and begins code execution. + The `Main` method uses , which follows the [builder pattern](https://wikipedia.org/wiki/Builder_pattern) to create a web app host. The builder has methods that define the web server (for example, ) and the startup class (). In the preceding example, the [Kestrel](xref:fundamentals/servers/kestrel) web server is used. Other web servers, such as [WebListener](xref:fundamentals/servers/weblistener), can be used by invoking the appropriate extension method. `UseStartup` is explained further in the next section. `WebHostBuilder` provides many optional methods, including for hosting in IIS and IIS Express and for specifying the root content directory. The and methods build the object that hosts the app and begins listening for HTTP requests.