diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index a965b409e8fe..893a0ffe37df 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -762,7 +762,7 @@ }, { "source_path": "aspnetcore/choose-aspnet-framework.md", - "redirect_url": "/aspnet/core/fundamentals/choose-aspnet-framework", + "redirect_url": "/aspnet/core/overview", "redirect_document_id": false }, { @@ -1572,6 +1572,16 @@ "source_path": "aspnetcore/getting-started/index.md", "redirect_url": "/aspnet/core/get-started", "redirect_document_id": false + }, + { + "source_path": "aspnetcore/fundamentals/choose-aspnet-framework.md", + "redirect_url": "/aspnet/core/overview", + "redirect_document_id": false + }, + { + "source_path": "aspnetcore/introduction-to-aspnet-core.md", + "redirect_url": "/aspnet/core/overview", + "redirect_document_id": false } ] } diff --git a/aspnetcore/fundamentals/choose-aspnet-framework.md b/aspnetcore/fundamentals/choose-aspnet-framework.md deleted file mode 100644 index 322b61e80c54..000000000000 --- a/aspnetcore/fundamentals/choose-aspnet-framework.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Choose between ASP.NET 4.x and ASP.NET Core -author: tdykstra -description: Explains ASP.NET Core vs. ASP.NET 4.x and how to choose between them. -ms.author: tdykstra -ms.custom: mvc -ms.date: 05/28/2025 -uid: fundamentals/choose-between-aspnet-and-aspnetcore ---- -# Choose between ASP.NET 4.x and ASP.NET Core - -ASP.NET Core is a redesign of ASP.NET 4.x. This article lists the differences between them. - -## ASP.NET Core - -ASP.NET Core is an open-source, cross-platform framework for building modern, cloud-based web apps on Windows, macOS, or Linux. - -[!INCLUDE[](~/includes/benefits.md)] - -## ASP.NET 4.x - -ASP.NET 4.x is a mature framework that provides the services needed to build enterprise-grade, server-based web apps on Windows. - -## Framework selection - -The following table compares ASP.NET Core to ASP.NET 4.x. - -| ASP.NET Core | ASP.NET 4.x | -|---|---| -|Build for Windows, macOS, or Linux|Build for Windows| -|[Razor Pages](xref:razor-pages/index) is the recommended approach to create a Web UI as of ASP.NET Core 2.x. See also [MVC](xref:mvc/overview), [Web API](xref:tutorials/first-web-api), and [SignalR](xref:signalr/introduction).|Use [Web Forms](/aspnet/web-forms), [SignalR](/aspnet/signalr), [MVC](/aspnet/mvc), [Web API](/aspnet/web-api/), [WebHooks](/aspnet/webhooks/), or [Web Pages](/aspnet/web-pages)| -|Multiple versions per machine|One version per machine| -|Develop with [Visual Studio](https://visualstudio.microsoft.com/vs/) or [Visual Studio Code](https://code.visualstudio.com/) using C# or F#|Develop with [Visual Studio](https://visualstudio.microsoft.com/vs/) using C#, VB, or F#| -|Higher performance than ASP.NET 4.x|Good performance| -|[Use the latest .NET runtime](/dotnet/standard/choosing-core-framework-server)|Use .NET Framework runtime| - -See [ASP.NET Core targeting .NET Framework](xref:index#target-framework) for information on ASP.NET Core 2.x support on .NET Framework. - -## ASP.NET Core scenarios - -* [Websites](xref:tutorials/first-mvc-app/start-mvc) -* [APIs](xref:tutorials/first-web-api) -* [Real-time](xref:signalr/introduction) -* [Deploy an ASP.NET Core app to Azure](/azure/app-service/app-service-web-get-started-dotnet) - -## ASP.NET 4.x scenarios - -* [Websites](/aspnet/mvc) -* [APIs](/aspnet/web-api) -* [Real-time](/aspnet/signalr) -* [Create an ASP.NET 4.x web app in Azure](/azure/app-service/app-service-web-get-started-dotnet-framework) - -## Additional resources - -* [Introduction to ASP.NET](/aspnet/overview) -* [Introduction to ASP.NET Core](xref:index) -* diff --git a/aspnetcore/fundamentals/index.md b/aspnetcore/fundamentals/index.md index 514af822d7f6..f6b177883e9c 100644 --- a/aspnetcore/fundamentals/index.md +++ b/aspnetcore/fundamentals/index.md @@ -236,6 +236,58 @@ In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/ For more information, see . +## How to download a sample + +Many of the articles and tutorials include links to sample code. + +1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main). +1. Unzip the `AspNetCore.Docs-main.zip` file. +1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*. + +### Preprocessor directives in sample code + +To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario. + +For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario: + +```csharp +#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode +``` + +To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out: + +```csharp +#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode +``` + +For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if). + +### Regions in sample code + +Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics. + +Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`: + +```csharp +#region snippet_WebHostDefaults +Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); +#endregion +``` + +The preceding C# code snippet is referenced in the topic's markdown file with the following line: + +```md +[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)] +``` + +You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic. + +For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets). + ## Additional resources * diff --git a/aspnetcore/fundamentals/index/includes/index3-7.md b/aspnetcore/fundamentals/index/includes/index3-7.md index 92365379d00d..820307480f92 100644 --- a/aspnetcore/fundamentals/index/includes/index3-7.md +++ b/aspnetcore/fundamentals/index/includes/index3-7.md @@ -424,4 +424,56 @@ In Razor `.cshtml` files, tilde-slash (`~/`) points to the web root. A path begi For more information, see . +## How to download a sample + +Many of the articles and tutorials include links to sample code. + +1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main). +1. Unzip the `AspNetCore.Docs-main.zip` file. +1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*. + +### Preprocessor directives in sample code + +To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario. + +For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario: + +```csharp +#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode +``` + +To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out: + +```csharp +#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode +``` + +For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if). + +### Regions in sample code + +Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics. + +Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`: + +```csharp +#region snippet_WebHostDefaults +Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); +#endregion +``` + +The preceding C# code snippet is referenced in the topic's markdown file with the following line: + +```md +[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)] +``` + +You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic. + +For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets). + :::moniker-end diff --git a/aspnetcore/fundamentals/index/includes/index8.md b/aspnetcore/fundamentals/index/includes/index8.md index 2f4dc4100de5..d6987b331482 100644 --- a/aspnetcore/fundamentals/index/includes/index8.md +++ b/aspnetcore/fundamentals/index/includes/index8.md @@ -211,4 +211,56 @@ In Razor `.cshtml` files, `~/` points to the web root. A path beginning with `~/ For more information, see . +## How to download a sample + +Many of the articles and tutorials include links to sample code. + +1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main). +1. Unzip the `AspNetCore.Docs-main.zip` file. +1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*. + +### Preprocessor directives in sample code + +To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario. + +For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario: + +```csharp +#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode +``` + +To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out: + +```csharp +#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode +``` + +For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if). + +### Regions in sample code + +Some sample apps contain sections of code surrounded by [#region](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) and [#endregion](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-endregion) C# directives. The documentation build system injects these regions into the rendered documentation topics. + +Region names usually contain the word "snippet." The following example shows a region named `snippet_WebHostDefaults`: + +```csharp +#region snippet_WebHostDefaults +Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); +#endregion +``` + +The preceding C# code snippet is referenced in the topic's markdown file with the following line: + +```md +[!code-csharp[](sample/SampleApp/Program.cs?name=snippet_WebHostDefaults)] +``` + +You may safely ignore or remove the `#region` and `#endregion` directives that surround the code. Don't alter the code within these directives if you plan to run the sample scenarios described in the topic. + +For more information, see [Contribute to the ASP.NET documentation: Code snippets](https://github.com/dotnet/AspNetCore.Docs/blob/main/CONTRIBUTING.md#code-snippets). + :::moniker-end diff --git a/aspnetcore/get-started.md b/aspnetcore/get-started.md index 902589c1f13a..fa91fc0777dc 100644 --- a/aspnetcore/get-started.md +++ b/aspnetcore/get-started.md @@ -248,7 +248,39 @@ In this tutorial, you learned how to: :::moniker-end -To learn more about ASP.NET Core, see the following: +To learn more about the fundamentals of ASP.NET Core, see the following: > [!div class="nextstepaction"] -> +> + +## Additional tutorials + +:::moniker range=">= aspnetcore-6.0" + +App type | Scenario | Tutorials +-------- | -------- | --------- +Web app | New server and client web development with Blazor | and +Web API | Server-based data processing with Minimal APIs | +Remote Procedure Call (RPC) app | Contract-first services using Protocol Buffers | +Real-time app | Server/client bidirectional communication | + +:::moniker-end + +:::moniker range="< aspnetcore-6.0" + +App type | Scenario | Tutorials +-------- | -------- | --------- +Web app | New server and client web development with Blazor | and +Web API | Server-based data processing | +Remote Procedure Call (RPC) app | Contract-first services using Protocol Buffers | +Real-time app | Server/client bidirectional communication | + +:::moniker-end + +## Additional resources + +* [Introduction to .NET](/dotnet/core/introduction) +* [Visual Studio](https://visualstudio.microsoft.com/) +* [Visual Studio Code](https://code.visualstudio.com/) +* [.NET Developer Community](https://dotnet.microsoft.com/platform/community) +* [.NET Live TV](https://live.dot.net) diff --git a/aspnetcore/includes/benefits.md b/aspnetcore/includes/benefits.md deleted file mode 100644 index e0d9d996a000..000000000000 --- a/aspnetcore/includes/benefits.md +++ /dev/null @@ -1,21 +0,0 @@ -ASP.NET Core provides the following benefits: - -* A unified story for building web UI and web APIs. -* Architected for testability. -* [Blazor](xref:blazor/index) lets you use C# in the browser alongside JavaScript. Share server-side and client-side app logic all written with .NET. -* [Razor Pages](xref:razor-pages/index) makes coding page-focused scenarios easier and more productive. -* Ability to develop and run on Windows, macOS, and Linux. -* Open-source and [community-focused](https://live.asp.net/). -* Integration of [modern, client-side frameworks](xref:blazor/index) and development workflows. -* Support for hosting Remote Procedure Call (RPC) services using [gRPC](xref:grpc/index). -* A cloud-ready, environment-based [configuration system](xref:fundamentals/configuration/index). -* Built-in [dependency injection](xref:fundamentals/dependency-injection). -* A lightweight, [high-performance](https://github.com/aspnet/benchmarks), and modular HTTP request pipeline. -* Ability to host on the following: - * [Kestrel](xref:fundamentals/servers/kestrel) - * [IIS](xref:host-and-deploy/iis/index) - * [HTTP.sys](xref:fundamentals/servers/httpsys) - * [Nginx](xref:host-and-deploy/linux-nginx) - * [Docker](xref:host-and-deploy/docker/index) -* [Side-by-side versioning](/dotnet/standard/choosing-core-framework-server#side-by-side-net-versions-per-application-level). -* Tooling that simplifies modern web development. diff --git a/aspnetcore/introduction-to-aspnet-core.md b/aspnetcore/introduction-to-aspnet-core.md deleted file mode 100644 index 145877d03460..000000000000 --- a/aspnetcore/introduction-to-aspnet-core.md +++ /dev/null @@ -1,249 +0,0 @@ ---- -title: Overview of ASP.NET Core -author: tdykstra -description: Get an overview of ASP.NET Core, a cross-platform, high-performance, open-source framework for building modern, cloud-enabled, Internet-connected apps. -ms.author: tdykstra -ms.custom: mvc -ms.date: 06/21/2025 -uid: index ---- -# Overview of ASP.NET Core - -By [Daniel Roth](https://github.com/danroth27), [Rick Anderson](https://twitter.com/RickAndMSFT), and [Shaun Luttin](https://mvp.microsoft.com/en-us/PublicProfile/5001182) - -[!INCLUDE[](~/includes/not-latest-version.md)] - -:::moniker range=">= aspnetcore-3.0" - -ASP.NET Core is a cross-platform, high-performance framework for building modern web applications. This [open-source](https://github.com/dotnet/aspnetcore) framework allows developers to create web applications, services, and APIs that can run on Windows, macOS, and Linux. It is built for large-scale app development and can handle any size workload, making it a robust choice for enterprise-level applications. - -With ASP.NET Core, you can: - -* Build web apps and services, [Azure IoT (Internet of Things)](https://azure.microsoft.com/solutions/iot) apps, and mobile backends. -* Use your favorite development tools on Windows, macOS, and Linux. -* Deploy to the cloud or on-premises. -* Run on [.NET](/dotnet/core/introduction). - -## Why choose ASP.NET Core? - -Millions of developers use or have used [ASP.NET 4.x](/aspnet/overview) to create web apps. ASP.NET Core is a redesign of ASP.NET 4.x, including architectural changes that result in a leaner, more modular framework. - -[!INCLUDE[](~/includes/benefits.md)] - -## Build web APIs and web UI using ASP.NET Core MVC - -ASP.NET Core MVC provides features to build [web APIs](xref:tutorials/first-web-api) and [web apps](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro): - -* The [Model-View-Controller (MVC) pattern](xref:mvc/overview) helps make your web APIs and web apps testable. -* [Blazor](xref:blazor/index), a component-based web UI framework based on C# that supports both server-side rendering and client-side rendering via WebAssembly. -* [Razor Pages](xref:razor-pages/index) is a page-based programming model that makes building web UI easier and more productive. -* [Razor markup](xref:mvc/views/razor) provides a productive syntax for [Razor Pages](xref:razor-pages/index) and [MVC views](xref:mvc/views/overview). -* [Tag Helpers](xref:mvc/views/tag-helpers/intro) enable server-side code to participate in creating and rendering HTML elements in Razor files. -* Built-in support for [multiple data formats and content negotiation](xref:web-api/advanced/formatting) lets your web APIs reach a broad range of clients, including browsers and mobile devices. -* [Model binding](xref:mvc/models/model-binding) automatically maps data from HTTP requests to action method parameters. -* [Model validation](xref:mvc/models/validation) automatically performs client-side and server-side validation. - -## Client-side development - -ASP.NET Core includes [Blazor](xref:blazor/index) for building richly interactive web UI, and also integrates with other popular frontend JavaScript frameworks like [Angular](/visualstudio/javascript/tutorial-asp-net-core-with-angular), [React](/visualstudio/javascript/tutorial-asp-net-core-with-react), [Vue](/visualstudio/javascript/tutorial-asp-net-core-with-vue), and [Bootstrap](https://getbootstrap.com/). For more information, see and related topics under *Client-side development*. - - - -## ASP.NET Core target frameworks - -ASP.NET Core 3.x or later can only target .NET. - -There are several advantages to targeting .NET, and these advantages increase with each release. Some advantages of .NET over .NET Framework include: - -* Cross-platform. Runs on Windows, macOS, and Linux. -* Improved performance -* [Side-by-side versioning](/dotnet/standard/choosing-core-framework-server#side-by-side-net-versions-per-application-level) -* New APIs -* Open source - -## Recommended learning path - -We recommend the following sequence of tutorials for an introduction to developing ASP.NET Core apps: - -1. Follow a tutorial for the app type you want to develop or maintain. - - |App type |Scenario |Tutorial | - |----------|----------|----------| - |Web app | Client-side web UI development |[Get started with Blazor](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro) | - |Web app | New server-side web UI development |[Get started with Razor Pages](xref:tutorials/razor-pages/razor-pages-start) | - |Web app | Maintaining an MVC app |[Get started with MVC](xref:tutorials/first-mvc-app/start-mvc)| - |Web API | RESTful HTTP services |[Create a web API](xref:tutorials/first-web-api)† | - |Remote Procedure Call app | Contract-first services using Protocol Buffers |[Get started with a gRPC service](xref:tutorials/grpc/grpc-start) | - |Real-time app | Bidirectional communication between servers and connected clients |[Get started with SignalR](xref:tutorials/signalr) | - -1. Follow a tutorial that shows how to do basic data access. - - |Scenario |Tutorial | - |----------|----------| - |New development |[Blazor with Entity Framework Core](xref:blazor/tutorials/movie-database-app/index) | - |New development |[Razor Pages with Entity Framework Core](xref:data/ef-rp/intro) | - |Maintaining an MVC app |[MVC with Entity Framework Core](xref:data/ef-mvc/intro) | - -1. Read an overview of ASP.NET Core [fundamentals](xref:fundamentals/index) that apply to all app types. - -1. Browse the table of contents for other topics of interest. - -†There's also an [interactive web API tutorial](/training/modules/build-web-api-net-core). No local installation of development tools is required. The code runs in an [Azure Cloud Shell](https://azure.microsoft.com/features/cloud-shell/) in your browser, and [curl](https://curl.haxx.se/) is used for testing. - -## Migrate from .NET Framework - -For a reference guide to migrating ASP.NET 4.x apps to ASP.NET Core, see . - -:::moniker-end - -:::moniker range="< aspnetcore-3.0" - -ASP.NET Core is a cross-platform, high-performance, [open-source](https://github.com/dotnet/aspnetcore) framework for building modern, cloud-enabled, Internet-connected apps. With ASP.NET Core, you can: - -* Build web apps and services, [Azure IoT (Internet of Things)](https://azure.microsoft.com/solutions/iot) apps, and mobile backends. -* Use your favorite development tools on Windows, macOS, and Linux. -* Deploy to the cloud or on-premises. -* Run on [.NET Core or .NET Framework](/dotnet/articles/standard/choosing-core-framework-server). - -## Why choose ASP.NET Core? - -Millions of developers use or have used [ASP.NET 4.x](/aspnet/overview) to create web apps. ASP.NET Core is a redesign of ASP.NET 4.x, with architectural changes that result in a leaner, more modular framework. - -[!INCLUDE[](~/includes/benefits.md)] - -## Build web APIs and web UI using ASP.NET Core MVC - -ASP.NET Core MVC provides features to build [web APIs](xref:tutorials/first-web-api) and [web apps](xref:tutorials/razor-pages/index): - -* The [Model-View-Controller (MVC) pattern](xref:mvc/overview) helps make your web APIs and web apps testable. -* [Razor Pages](xref:razor-pages/index) is a page-based programming model that makes building web UI easier and more productive. -* [Razor markup](xref:mvc/views/razor) provides a productive syntax for [Razor Pages](xref:razor-pages/index) and [MVC views](xref:mvc/views/overview). -* [Tag Helpers](xref:mvc/views/tag-helpers/intro) enable server-side code to participate in creating and rendering HTML elements in Razor files. -* Built-in support for [multiple data formats and content negotiation](xref:web-api/advanced/formatting) lets your web APIs reach a broad range of clients, including browsers and mobile devices. -* [Model binding](xref:mvc/models/model-binding) automatically maps data from HTTP requests to action method parameters. -* [Model validation](xref:mvc/models/validation) automatically performs client-side and server-side validation. - -## Client-side development - -ASP.NET Core integrates seamlessly with popular client-side frameworks and libraries, including [Blazor](xref:blazor/index), [Angular](/visualstudio/javascript/tutorial-asp-net-core-with-angular), [React](/visualstudio/javascript/tutorial-asp-net-core-with-react), [Vue](/visualstudio/javascript/tutorial-asp-net-core-with-vue), and [Bootstrap](https://getbootstrap.com/). For more information, see and related topics under *Client-side development*. - - - -## ASP.NET Core targeting .NET Framework - -ASP.NET Core 2.x can target .NET Core or .NET Framework. ASP.NET Core apps targeting .NET Framework aren't cross-platform—they run on Windows only. Generally, ASP.NET Core 2.x is made up of [.NET Standard](/dotnet/standard/net-standard) libraries. Libraries written with .NET Standard 2.0 run on any [.NET platform that implements .NET Standard 2.0](/dotnet/standard/net-standard#net-implementation-support). - -ASP.NET Core 2.x is supported on .NET Framework versions that implement .NET Standard 2.0: - -* .NET Framework latest version is recommended. -* .NET Framework 4.6.1 or later. - -ASP.NET Core 3.0 or later only run on .NET Core. For more details regarding this change, see [A first look at changes coming in ASP.NET Core 3.0](https://blogs.msdn.microsoft.com/webdev/2018/10/29/a-first-look-at-changes-coming-in-asp-net-core-3-0/). - -There are several advantages to targeting .NET Core, and these advantages increase with each release. Some advantages of .NET Core over .NET Framework include: - -* Cross-platform. Runs on macOS, Linux, and Windows. -* Improved performance -* [Side-by-side versioning](/dotnet/standard/choosing-core-framework-server#side-by-side-net-versions-per-application-level) -* New APIs -* Open source - -To help close the API gap from .NET Framework to .NET Core, the [Windows Compatibility Pack](/dotnet/core/porting/windows-compat-pack) made thousands of Windows-only APIs available in .NET Core. These APIs weren't available in .NET Core 1.x. - -## Recommended learning path - -We recommend the following sequence of tutorials and articles for an introduction to developing ASP.NET Core apps: - -1. Follow a tutorial for the type of app you want to develop or maintain. - - |App type |Scenario |Tutorial | - |----------|----------|----------| - |Web app | For new development |[Get started with Razor Pages](xref:tutorials/razor-pages/razor-pages-start) | - |Web app | For maintaining an MVC app |[Get started with MVC](xref:tutorials/first-mvc-app/start-mvc)| - |Web API | |[Create a web API](xref:tutorials/first-web-api)† | - |Real-time app | |[Get started with SignalR](xref:tutorials/signalr) | - -1. Follow a tutorial that shows how to do basic data access. - - |Scenario |Tutorial | - |----------|----------| - | For new development |[Razor Pages with Entity Framework Core](xref:data/ef-rp/intro) | - | For maintaining an MVC app |[MVC with Entity Framework Core](xref:data/ef-mvc/intro) | - -1. Read an overview of ASP.NET Core [fundamentals](xref:fundamentals/index) that apply to all app types. - -1. Browse the Table of Contents for other topics of interest. - -†There's also a [web API tutorial that you follow entirely in the browser](/training/modules/build-web-api-net-core), no local IDE installation required. The code runs in an [Azure Cloud Shell](https://azure.microsoft.com/features/cloud-shell/), and [curl](https://curl.haxx.se/) is used for testing. - -## Migrate from .NET Framework - -For a reference guide to migrating ASP.NET apps to ASP.NET Core, see . - -:::moniker-end - -## How to download a sample - -Many of the articles and tutorials include links to sample code. - -1. [Download the ASP.NET repository zip file](https://codeload.github.com/dotnet/AspNetCore.Docs/zip/main). -1. Unzip the `AspNetCore.Docs-main.zip` file. -1. To access an article's sample app in the unzipped repository, use the URL in the article's sample link to help you navigate to the sample's folder. Usually, an article's sample link appears at the top of the article with the link text *View or download sample code*. - -### Preprocessor directives in sample code - -To demonstrate multiple scenarios, sample apps use the `#define` and `#if-#else/#elif-#endif` preprocessor directives to selectively compile and run different sections of sample code. For those samples that make use of this approach, set the `#define` directive at the top of the C# files to define the symbol associated with the scenario that you want to run. Some samples require defining the symbol at the top of multiple files in order to run a scenario. - -For example, the following `#define` symbol list indicates that four scenarios are available (one scenario per symbol). The current sample configuration runs the `TemplateCode` scenario: - -```csharp -#define TemplateCode // or LogFromMain or ExpandDefault or FilterInCode -``` - -To change the sample to run the `ExpandDefault` scenario, define the `ExpandDefault` symbol and leave the remaining symbols commented-out: - -```csharp -#define ExpandDefault // TemplateCode or LogFromMain or FilterInCode -``` - -For more information on using [C# preprocessor directives](/dotnet/csharp/language-reference/preprocessor-directives/) to selectively compile sections of code, see [#define (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define) and [#if (C# Reference)](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if). - - - -## Breaking changes and security advisories - -[!INCLUDE[](~/includes/announcements.md)] - -## Next steps - -For more information, see the following resources: - -* [Get started with Blazor](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/intro) -* -* -* [ASP.NET Core fundamentals](xref:fundamentals/index) -* [The weekly ASP.NET community standup](https://live.asp.net/) covers the team's progress and plans. It features new blogs and third-party software. diff --git a/aspnetcore/overview.md b/aspnetcore/overview.md new file mode 100644 index 000000000000..b6b28afeb5ab --- /dev/null +++ b/aspnetcore/overview.md @@ -0,0 +1,84 @@ +--- +title: Overview of ASP.NET Core +author: tdykstra +description: Get an overview of ASP.NET Core, a cross-platform, high-performance, open-source framework for building modern, cloud-enabled, Internet-connected apps. +ms.author: tdykstra +ms.custom: mvc +ms.date: 07/28/2025 +uid: index +--- +# Overview of ASP.NET Core + +[!INCLUDE[](~/includes/not-latest-version.md)] + +ASP.NET Core is a cross-platform, high-performance, open-source framework for building modern web apps using [.NET](/dotnet/core/introduction). The framework is built for large-scale app development and can handle any size workload, making it a robust choice for enterprise-level apps. + +Key features: + +:::moniker range=">= aspnetcore-6.0" + +* Lightweight and modular HTTP request pipeline. +* [Kestrel](xref:fundamentals/servers/kestrel): A [high-performance](https://github.com/aspnet/benchmarks) and cross-platform HTTP server. +* Integrated [dependency injection](xref:fundamentals/dependency-injection). +* [Environment-based configuration](xref:fundamentals/configuration/index). +* Rich logging, tracing, and runtime metrics. +* [Blazor](xref:blazor/index): Create rich interactive web UI components using [C#](/dotnet/csharp/)—no JavaScript required. +* Integrate seamlessly with popular client-side frameworks and libraries, including [Angular](/visualstudio/javascript/tutorial-asp-net-core-with-angular), [React](/visualstudio/javascript/tutorial-asp-net-core-with-react), [Vue](/visualstudio/javascript/tutorial-asp-net-core-with-vue), and [Bootstrap](https://getbootstrap.com/). +* [Minimal APIs](xref:fundamentals/minimal-apis): Build fast web APIs with minimal code and configuration by fluently declaring API routes and endpoints. +* [SignalR](xref:signalr/index): Add real-time web functionality. +* [gRPC](xref:grpc/index): High performance Remote Procedure Call (RPC) services. +* Security: Built-in security features for [authentication](xref:security/authentication/index), [authorization](xref:security/authorization/introduction), and [data protection](xref:security/data-protection/introduction). +* Testing: Easily create unit and integration tests. +* Tooling: Maximize your development productivity with [Visual Studio](https://visualstudio.microsoft.com/) and [Visual Studio Code](https://code.visualstudio.com/). + +:::moniker-end + +:::moniker range=">= aspnetcore-3.0 < aspnetcore-6.0" + +* Lightweight and modular HTTP request pipeline. +* [Kestrel](xref:fundamentals/servers/kestrel): A [high-performance](https://github.com/aspnet/benchmarks) and cross-platform HTTP server. +* Integrated [dependency injection](xref:fundamentals/dependency-injection). +* [Environment-based configuration](xref:fundamentals/configuration/index). +* Rich logging, tracing, and runtime metrics. +* [Blazor](xref:blazor/index): Create rich interactive web UI components using [C#](/dotnet/csharp/)—no JavaScript required. +* Integrate seamlessly with popular client-side frameworks and libraries, including [Angular](/visualstudio/javascript/tutorial-asp-net-core-with-angular), [React](/visualstudio/javascript/tutorial-asp-net-core-with-react), [Vue](/visualstudio/javascript/tutorial-asp-net-core-with-vue), and [Bootstrap](https://getbootstrap.com/). +* [SignalR](xref:signalr/index): Add real-time web functionality. +* [gRPC](xref:grpc/index): High performance Remote Procedure Call (RPC) services. +* Security: Built-in security features for [authentication](xref:security/authentication/index), [authorization](xref:security/authorization/introduction), and [data protection](xref:security/data-protection/introduction). +* Testing: Easily create unit and integration tests. +* Tooling: Maximize your development productivity with [Visual Studio](https://visualstudio.microsoft.com/) and [Visual Studio Code](https://code.visualstudio.com/). + +:::moniker-end + +:::moniker range="< aspnetcore-3.0" + +* Lightweight and modular HTTP request pipeline. +* [Kestrel](xref:fundamentals/servers/kestrel): A [high-performance](https://github.com/aspnet/benchmarks) and cross-platform HTTP server. +* Integrated [dependency injection](xref:fundamentals/dependency-injection). +* [Environment-based configuration](xref:fundamentals/configuration/index). +* Rich logging, tracing, and runtime metrics. +* Develop apps and APIs using [Razor Pages](xref:razor-pages/index) and [Model-View-Controller (MVC)](xref:mvc/overview) frameworks. +* Integrate seamlessly with popular client-side frameworks and libraries, including [Angular](/visualstudio/javascript/tutorial-asp-net-core-with-angular), [React](/visualstudio/javascript/tutorial-asp-net-core-with-react), [Vue](/visualstudio/javascript/tutorial-asp-net-core-with-vue), and [Bootstrap](https://getbootstrap.com/). +* [SignalR](xref:signalr/index): Add real-time web functionality. +* [gRPC](xref:grpc/index): High performance Remote Procedure Call (RPC) services. +* Security: Built-in security features for [authentication](xref:security/authentication/index), [authorization](xref:security/authorization/introduction), and [data protection](xref:security/data-protection/introduction). +* Testing: Easily create unit and integration tests. +* Tooling: Maximize your development productivity with [Visual Studio](https://visualstudio.microsoft.com/) and [Visual Studio Code](https://code.visualstudio.com/). + +:::moniker-end + +## Why choose ASP.NET Core? + +* **Unified framework**: ASP.NET Core is a complete and fully integrated web framework with built-in production-ready components to handle all of your web development needs. +* **Full stack productivity**: Build more apps faster by enabling your team to work full stack, from the frontend to the backend, using a single development framework. +* **Secure by design**: ASP.NET Core is built with security as a top concern and includes built-in support for authentication, authorization, and data protection. +* **Cloud-ready**: Whether you're deploying to your own data centers or to the cloud, ASP.NET Core simplifies deployment, monitoring, and configuration. +* **Performance & scalability**: Handle the most demanding workloads with ASP.NET Core's industry leading performance. +* **Trusted and mature**: ASP.NET Core is used and proven at hyperscale by some of the largest services in the world, including Bing, Xbox, Microsoft 365, and Azure. + +## Get started + +Are you ready to start your ASP.NET Core learning journey? It's time to build your first web app with ASP.NET Core! + +> [!div class="nextstepaction"] +> diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index 3888d1d06397..6e1f7e1c92f3 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -2,13 +2,7 @@ items: - name: ASP.NET Core documentation href: index.yml - name: Overview - items: - - name: About ASP.NET Core - uid: index - - name: Compare ASP.NET Core and ASP.NET - uid: fundamentals/choose-between-aspnet-and-aspnetcore - - name: Compare .NET and .NET Framework - href: /dotnet/standard/choosing-core-framework-server?toc=/aspnet/core/toc.json&bc=/aspnet/core/breadcrumb/toc.json + uid: index - name: Get started uid: get-started - name: What's new