Asp.net Core
Overview
startup class
Dependency injection (services)
makes configured services available throughout an app.
Middleware
Host
encapsulates all of the app's resources
Configuration
Servers
Environments
Logging
Routing
Error handling
Make HTTP Requests
Content Root
Web Root
ConfigureServices
Configure
Services required by the app are configured.
The app's request handling pipeline is defined, as a series of middleware components.
Constructor Injection
a class declares a constructor parameter of either the required type or an interface. The DI framework provides an instance of this service at runtime.
Use...
Component
Each component performs operations on an HttpContext and either invokes the next middleware in the pipeline or terminates the request.
By convention, a middleware component is added to the pipeline by invoking a Use... extension method
.Net Generic Host
ASP.NET Core Web Host
recommended
is available only for backwards compatibility.
CreateDefaultBuilder
ConfigureWebHostDefaults
HttpContext
Kestrel
IIS HTTP Server
HTTP.sys
appSettings.json
Options pattern
Secret Manager
Azure Key vault
Development, Staging, Production
IWebHostEnvironment
ASPNETCORE_ENVIRONMENT
supports a logging API that works with a variety of built-in and third-party logging providers.
Available Providers
Console
Debug
Event Tracing on Windows
Windows Event Log
TraceSource
Azure App Service
Azure Application Insights
ILogger, LogInformation
Semantic Logging/Structured Logging
Route
Handlers
Built-in Features
A developer exception page
Custom error pages
Static status code pages
Startup exception handling
IHttpClientFactory
HttpClient
HttpClientHandler
Base Path for
The executable hosting the app (.exe).
Compiled assemblies that make up the app (.dll).
Content files used by the app, such as:
Razor files (.cshtml, .razor)
Configuration files (.json, .xml)
Data files (.db)
The Web root, typically the wwwroot folder.
Base path for
Stylesheets (.css)
JavaScript (.js)
Images (.png, .jpg)
virtual path (