0% found this document useful (0 votes)
9 views

ASP 01 Introduction

ASP.NET Core is a free, open-source, cross-platform framework for building cloud-based applications, offering enhanced performance, modularity, and scalability. It supports various hosting options, including Kestrel and cloud services, and features built-in dependency injection and logging. The framework is designed for modern web development, facilitating the creation of web apps, mobile backends, and IoT applications.

Uploaded by

messagetome133
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

ASP 01 Introduction

ASP.NET Core is a free, open-source, cross-platform framework for building cloud-based applications, offering enhanced performance, modularity, and scalability. It supports various hosting options, including Kestrel and cloud services, and features built-in dependency injection and logging. The framework is designed for modern web development, facilitating the creation of web apps, mobile backends, and IoT applications.

Uploaded by

messagetome133
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

ASP.

NET Core Overview

ASP.NET Core is a free, open-source, and cross-platform framework for building cloud-based
applications, such as web apps, IoT apps, and mobile backends. It is designed to run on the
cloud as well as on-premises.
ASP.NET Core is not an upgraded version of ASP.NET. ASP.NET Core is completely
rewriting that work with the .net Core framework. It is much faster, configurable, modular,
scalable, extensible, and has cross-platform support. It is best suitable for developing cloud-
based such as web applications, mobile applications, and IoT applications.

Key Features:
 Cross-Platform: ASP.NET Core applications can be developed and run on Windows,
Linux, and macOS, providing flexibility and broad reach.
 Hosting Options: Applications can be hosted using various servers, including:

 Kestrel: A cross-platform web server for ASP.NET Core.

 IIS: Internet Information Services for Windows Server.

 Nginx and Apache: Popular web servers on Linux and macOS.

 Docker: Containerization support for consistent deployments.

 Cloud Services: Seamless integration with cloud providers like Microsoft Azure.

 Open-Source: The framework is developed and maintained by the .NET Foundation


and the open-source community, fostering transparency and collaboration.

 Cloud-Enabled: ASP.NET Core is designed with cloud-based applications in mind,


offering features that facilitate development and deployment in cloud environments.

 Built-in supports for Dependency Injection

 Built-in supports for the logging framework and it can be extensible

 Command-line supports to creating, building, and running of the application

 There is no web .config file. We can store the custom configuration into an
appsettings.json file

 It has good support for asynchronous programming


Modules:
 ASP.NET Core MVC: For building robust web applications following the Model-View-
Controller pattern.

 ASP.NET Core Web API: For creating RESTful services accessible by various clients,
including browsers and mobile devices.

 ASP.NET Core Razor Pages: For developing page-focused web applications with a
simplified coding model.

 ASP.NET Core Blazor: For building interactive web UIs using C# instead of JavaScript.

Comparison with Previous Technologies:

Feature ASP.NET Web Forms ASP.NET MVC ASP.NET Core

Initial Release 2002 2009 2016

Performance Moderate Improved High

Cross-Platform No No Yes

Cloud-Friendly Limited Improved Yes

Open Source No Partial Yes

Development Model Event-Driven MVC Pattern Multiple Patterns

ASP.NET Core represents a significant evolution, offering enhanced performance, cross-platform


capabilities, and modern development features suitable for today's web applications.

What is a Web Application Framework?

A web application framework simplifies the development of modern web applications by


providing reusable tools and libraries. It helps handle recurring tasks, such as:

managing HTTP requests, user authentication, database interactions, URL routing, and
output formatting (HTML/JSON).

Benefits: Frameworks reduce complexity, Improve scalability, Increase development


productivity.
ASP.NET Core Application Notes and Server Cheat Sheet

Kestrel and Other Servers

 Kestrel: The cross-platform web server for ASP.NET Core, lightweight and efficient for
handling dynamic content.

 Reverse Proxy Servers: These servers forward client requests to backend servers and
return responses to clients.

o IIS, Nginx, Apache.

Kestrel
Overview:
 Kestrel is the cross-platform web server for ASP.NET Core.

 It is lightweight and suitable for serving dynamic content.

Responsibilities:
 Handles HTTP requests: Handles incoming HTTP requests and responses.

 Hosting: Hosts the ASP.NET Core application.

 Configuration: Supports various configurations such as HTTP/2, HTTPS, etc.

Use Case:
 Ideal for development and internal networks.

 Typically used in conjunction with a reverse proxy for production environments.


Reverse Proxy Servers
Overview:
 A reverse proxy server forwards client requests to backend servers and returns the
responses to the clients.

 Common reverse proxy servers include Nginx, Apache, and IIS.

Responsibilities:
 Load Balancing: Distributes incoming requests across multiple servers.

 SSL Termination: Handles SSL/TLS encryption and decryption.

 Caching: Caches responses to improve performance.

 Security: Provides additional security features like request filtering, IP whitelisting,


and rate limiting.

Use Case:
 Used in front of Kestrel to enhance security, load balancing, and other enterprise-
level requirements.

Responsibilities of Kestrel and Reverse Proxy Servers

Kestrel:
 Serves HTTP requests directly.

 Provides efficient request processing.

 Should be used behind a reverse proxy for additional security and stability.

Reverse Proxy:
 Acts as an intermediary between clients and Kestrel.

 Provides SSL termination, load balancing, and security features.

 Enhances the overall performance and security of the application.

Explanation of the Code in Detail

1| var builder = WebApplication.CreateBuilder(args);


2| var app = builder.Build();
3| app.MapGet("/", () => "Hello World!");
4| app.Run();
1. var builder = WebApplication.CreateBuilder(args);

o Purpose: Initializes a new WebApplicationBuilder instance to configure the


application.

o Key Features:

 Reads configuration settings from sources like appsettings.json and


environment variables.

 Configures default logging.

 Sets up dependency injection (DI) for services.

2. var app = builder.Build();

o Purpose: Builds the WebApplication instance.

o Key Features:

 Finalizes the app's configuration.

 Compiles middleware components.

 Creates the WebApplication object to handle HTTP requests.

3. app.MapGet("/", () => "Hello World!");

o Purpose: Defines a route for HTTP GET requests.

o Key Features:

 Maps requests to the root URL (/).

 Responds with the string "Hello World!" using a lambda expression.

4. app.Run();

o Purpose: Starts the web application.

o Key Features:

 Launches the Kestrel server and listens for HTTP requests.

 Keeps the application running until manually stopped.

You might also like