MSDN Documentation

Introduction to ASP.NET Core

Welcome to the official Microsoft documentation for ASP.NET Core. This section provides a comprehensive guide to building modern, cross-platform web applications and services with .NET.

What is ASP.NET Core?

ASP.NET Core is a free, open-source, cross-platform framework for building modern, cloud-based, internet-connected applications. It is a rewrite of the ASP.NET platform, designed to:

Key Concepts

Understanding these core concepts is crucial for developing with ASP.NET Core:

  1. Middleware Pipeline: ASP.NET Core applications are built around a pipeline of middleware components. Each component can process incoming HTTP requests and outgoing HTTP responses.
  2. Request Delegate (Delegate): A function that processes an HTTP request. Middleware components are chained together to form the request pipeline.
  3. Dependency Injection (DI): ASP.NET Core has built-in support for DI, making it easier to manage dependencies and create loosely coupled applications.
  4. Configuration: ASP.NET Core provides a flexible configuration system that supports various sources like JSON files, environment variables, and command-line arguments.
  5. Hosting: The `IHost` and `IHostBuilder` are responsible for setting up and running your ASP.NET Core application, including managing its lifecycle and services.
  6. Kestrel: A cross-platform web server built by the .NET Foundation, used by default to host ASP.NET Core applications.

Getting Started

To start building with ASP.NET Core, you'll need the .NET SDK installed. Here's a basic overview of creating your first application:

1. Create a New Project

You can use the .NET CLI to create a new web application:

dotnet new webapp -o MyAspNetCoreApp
cd MyAspNetCoreApp

2. Run the Application

Navigate into the project directory and run the application:

dotnet run

This will start the Kestrel web server, and you can access your application by navigating to the URL provided in the console output (usually https://localhost:5001 or http://localhost:5000).

3. Project Structure

A typical ASP.NET Core web application project will have files and folders like:

Core Features

Next Steps

Explore the following resources to deepen your understanding and skills:

For detailed API information, please refer to the ASP.NET Core API Reference.