diff --git a/.github/ISSUE_TEMPLATE/customer-feedback.yml b/.github/ISSUE_TEMPLATE/customer-feedback.yml index ac66b8d7d973..2f7906784fce 100644 --- a/.github/ISSUE_TEMPLATE/customer-feedback.yml +++ b/.github/ISSUE_TEMPLATE/customer-feedback.yml @@ -38,6 +38,12 @@ body: required: true attributes: label: Document ID + - type: input + id: platformId + validations: + required: true + attributes: + label: Platform Id - type: input id: author validations: diff --git a/aspnetcore/blazor/security/includes/usermanager-signinmanager.md b/aspnetcore/blazor/security/includes/usermanager-signinmanager.md index 31c5f9ebb769..ae98e1e26f2a 100644 --- a/aspnetcore/blazor/security/includes/usermanager-signinmanager.md +++ b/aspnetcore/blazor/security/includes/usermanager-signinmanager.md @@ -30,7 +30,10 @@ services.Configure(options => The following `WeatherForecastController` logs the when the `Get` method is called. > [!NOTE] -> The following example uses a [file-scoped namespace](/dotnet/csharp/language-reference/keywords/namespace), which is a C# 10 or later (.NET 6 or later) feature. +> The following example uses: +> +> * A [file-scoped namespace](/dotnet/csharp/language-reference/keywords/namespace), which is a C# 10 or later (.NET 6 or later) feature. +> * A [primary constructor](/dotnet/csharp/whats-new/tutorials/primary-constructors), which is a C# 12 or later (.NET 8 or later) feature. ```csharp using System; @@ -49,25 +52,15 @@ namespace BlazorSample.Server.Controllers; [Authorize] [ApiController] [Route("[controller]")] -public class WeatherForecastController : ControllerBase +public class WeatherForecastController(ILogger logger, + UserManager userManager) : ControllerBase { - private readonly UserManager userManager; - private static readonly string[] Summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; - private readonly ILogger logger; - - public WeatherForecastController(ILogger logger, - UserManager userManager) - { - this.logger = logger; - this.userManager = userManager; - } - [HttpGet] public async Task> Get() { diff --git a/aspnetcore/fundamentals/aot/request-delegate-generator/rdg.md b/aspnetcore/fundamentals/aot/request-delegate-generator/rdg.md index fef941ab05c7..a2c781b95ea0 100644 --- a/aspnetcore/fundamentals/aot/request-delegate-generator/rdg.md +++ b/aspnetcore/fundamentals/aot/request-delegate-generator/rdg.md @@ -1,5 +1,4 @@ --- - title: ASP.NET Core Request Delegate Generator (RDG) for Native AOT description: Turn Map methods into request delegates with the ASP.NET Core Request Delegate Generator (RDG) for Native AOT. author: rick-anderson @@ -48,7 +47,17 @@ The RDG: * Is enabled automatically in projects when publishing with Native AOT is enabled or when trimming is enabled. * Can be manually enabled even when not using Native AOT by setting `true` in the project file: -:::code language="xml" source="~/fundamentals/aot/samples/rdg/RDG.csproj" highlight="7"::: +:::moniker range=">= aspnetcore-10.0" + +:::code language="xml" source="~/fundamentals/aot/samples/10.0/rdg/RDG.csproj" highlight="7"::: + +:::moniker-end + +:::moniker range="< aspnetcore-10.0" + +:::code language="xml" source="~/fundamentals/aot/samples/8.0/rdg/RDG.csproj" highlight="7"::: + +:::moniker-end Manually enabling RDG can be useful for: @@ -57,7 +66,17 @@ Manually enabling RDG can be useful for: Minimal APIs are optimized for using , which requires using the [System.Text.Json source generator](/dotnet/standard/serialization/system-text-json/source-generation). All types accepted as parameters to or returned from request delegates in Minimal APIs must be configured on a that's registered via ASP.NET Core's dependency injection: -:::code language="csharp" source="~/fundamentals/aot/samples/rdg/Program.cs" highlight="5-9,32-99"::: +:::moniker range=">= aspnetcore-10.0" + +:::code language="csharp" source="~/fundamentals/aot/samples/10.0/rdg/Program.cs" highlight="5-9,34-36"::: + +:::moniker-end + +:::moniker range="< aspnetcore-10.0" + +:::code language="csharp" source="~/fundamentals/aot/samples/8.0/rdg/Program.cs" highlight="5-9,32-35"::: + +:::moniker-end ## Diagnostics for unsupported RDG scenarios diff --git a/aspnetcore/fundamentals/aot/samples/10.0/rdg/Program.cs b/aspnetcore/fundamentals/aot/samples/10.0/rdg/Program.cs new file mode 100644 index 000000000000..d50139281f37 --- /dev/null +++ b/aspnetcore/fundamentals/aot/samples/10.0/rdg/Program.cs @@ -0,0 +1,36 @@ +using System.Text.Json.Serialization; + +var builder = WebApplication.CreateSlimBuilder(args); + +builder.Services.ConfigureHttpJsonOptions(options => +{ + options.SerializerOptions.TypeInfoResolverChain.Insert( + 0, AppJsonSerializerContext.Default); +}); + +var app = builder.Build(); + +Todo[] sampleTodos = +[ + new(1, "Walk the dog"), + new(2, "Do the dishes", DateOnly.FromDateTime(DateTime.Now)), + new(3, "Do the laundry", DateOnly.FromDateTime(DateTime.Now.AddDays(1))), + new(4, "Clean the bathroom"), + new(5, "Clean the car", DateOnly.FromDateTime(DateTime.Now.AddDays(2))) +]; + +var todosApi = app.MapGroup("/todos"); +todosApi.MapGet("/", () => sampleTodos); +todosApi.MapGet("/{id}", (int id) => + sampleTodos.FirstOrDefault(a => a.Id == id) is { } todo + ? Results.Ok(todo) + : Results.NotFound()); + +app.Run(); + +public record Todo(int Id, string? Title, DateOnly? DueBy = null, bool IsComplete = false); + +[JsonSerializable(typeof(Todo[]))] +internal partial class AppJsonSerializerContext : JsonSerializerContext +{ +} diff --git a/aspnetcore/fundamentals/aot/samples/10.0/rdg/RDG.csproj b/aspnetcore/fundamentals/aot/samples/10.0/rdg/RDG.csproj new file mode 100644 index 000000000000..e17c20245c91 --- /dev/null +++ b/aspnetcore/fundamentals/aot/samples/10.0/rdg/RDG.csproj @@ -0,0 +1,10 @@ + + + + net10.0 + enable + enable + true + + + diff --git a/aspnetcore/fundamentals/aot/samples/rdg/Program.cs b/aspnetcore/fundamentals/aot/samples/8.0/rdg/Program.cs similarity index 99% rename from aspnetcore/fundamentals/aot/samples/rdg/Program.cs rename to aspnetcore/fundamentals/aot/samples/8.0/rdg/Program.cs index b358c475c7b5..89a64fc42f79 100644 --- a/aspnetcore/fundamentals/aot/samples/rdg/Program.cs +++ b/aspnetcore/fundamentals/aot/samples/8.0/rdg/Program.cs @@ -32,5 +32,4 @@ public record Todo(int Id, string? Title, DateOnly? DueBy = null, bool IsComplet [JsonSerializable(typeof(Todo[]))] internal partial class AppJsonSerializerContext : JsonSerializerContext { - } diff --git a/aspnetcore/fundamentals/aot/samples/rdg/RDG.csproj b/aspnetcore/fundamentals/aot/samples/8.0/rdg/RDG.csproj similarity index 100% rename from aspnetcore/fundamentals/aot/samples/rdg/RDG.csproj rename to aspnetcore/fundamentals/aot/samples/8.0/rdg/RDG.csproj diff --git a/aspnetcore/fundamentals/aot/samples/Program.cs b/aspnetcore/fundamentals/aot/samples/Program.cs index d71dc7e7cf18..698e706716ff 100644 --- a/aspnetcore/fundamentals/aot/samples/Program.cs +++ b/aspnetcore/fundamentals/aot/samples/Program.cs @@ -25,5 +25,4 @@ [JsonSerializable(typeof(Todo[]))] internal partial class AppJsonSerializerContext : JsonSerializerContext { - } diff --git a/aspnetcore/fundamentals/openapi/aspnetcore-openapi.md b/aspnetcore/fundamentals/openapi/aspnetcore-openapi.md index 9d10200bf2f3..fff1d7f5517f 100644 --- a/aspnetcore/fundamentals/openapi/aspnetcore-openapi.md +++ b/aspnetcore/fundamentals/openapi/aspnetcore-openapi.md @@ -5,7 +5,7 @@ description: Learn how to generate and customize OpenAPI documents in an ASP.NET ms.author: safia monikerRange: '>= aspnetcore-6.0' ms.custom: mvc -ms.date: 01/23/2025 +ms.date: 2/23/2025 uid: fundamentals/openapi/aspnetcore-openapi --- # Generate OpenAPI documents @@ -14,7 +14,7 @@ uid: fundamentals/openapi/aspnetcore-openapi The [`Microsoft.AspNetCore.OpenApi`](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi) package provides built-in support for OpenAPI document generation in ASP.NET Core. The package provides the following features: -* Support for generating OpenAPI documents at run time and accessing them via an endpoint on the application. +* Support for generating OpenAPI documents at run time and accessing them via an endpoint on the app. * Support for "transformer" APIs that allow modifying the generated document. * Support for generating multiple OpenAPI documents from a single app. * Takes advantage of JSON schema support provided by [`System.Text.Json`](/dotnet/api/system.text.json). @@ -112,7 +112,7 @@ The OpenAPI endpoint doesn't enable any authorization checks by default. Howeve #### Cache generated OpenAPI document -The OpenAPI document is regenerated every time a request to the OpenAPI endpoint is sent. Regeneration enables transformers to incorporate dynamic application state into their operation. For example, regenerating a request with details of the HTTP context. When applicable, the OpenAPI document can be cached to avoid executing the document generation pipeline on each HTTP request. +The OpenAPI document is regenerated every time a request to the OpenAPI endpoint is sent. Regeneration enables transformers to incorporate dynamic app state into their operation. For example, regenerating a request with details of the HTTP context. When applicable, the OpenAPI document can be cached to avoid executing the document generation pipeline on each HTTP request. [!code-csharp[](~/fundamentals/openapi/samples/9.x/WebMinOpenApi/Program.cs?name=snippet_mapopenapiwithcaching)] @@ -122,7 +122,7 @@ In some scenarios, it's helpful to generate multiple OpenAPI documents with diff * Generating OpenAPI documentation for different audiences, such as public and internal APIs. * Generating OpenAPI documentation for different versions of an API. -* Generating OpenAPI documentation for different parts of an application, such as a frontend and backend API. +* Generating OpenAPI documentation for different parts of an app, such as a frontend and backend API. To generate multiple OpenAPI documents, call the extension method once for each document, specifying a different document name in the first parameter each time. @@ -135,9 +135,12 @@ Each invocation of delegate method of to determine which endpoints to include in each document. -For each document, the delegate method is called for each endpoint in the application, passing the object for the endpoint. The method returns a boolean value indicating whether the endpoint should be included in the document. The object contains information about the endpoint, such as the HTTP method, route, and response types, as well as metadata attached to the endpoint via attributes or extension methods. +For each document, the delegate method is called for each endpoint in the app, passing the object for the endpoint. The method returns a boolean value indicating whether the endpoint should be included in the document. The object: -The default implementation of this delegate uses the field of , which is set on an endpoint using either the extension method or the attribute, to determine which endpoints to include in the document. Any endpoint that has not been assigned a group name is included all OpenAPI documents. +* contains information about the endpoint, such as the HTTP method, route, and response types +* Metadata attached to the endpoint via attributes or extension methods. + +The default implementation of this delegate uses the field of . The delegate is set on an endpoint using either the extension method or the attribute. `WithGroupName` or the `EndpointGroupName` attribute determines which endpoints to include in the document. Any endpoint that has not been assigned a group name is included all OpenAPI documents. ```csharp // Include endpoints without a group name or with a group name that matches the document name @@ -148,13 +151,13 @@ You can customize the @@ -198,7 +218,7 @@ The value of `OpenApiDocumentsDirectory` is resolved relative to the project fil #### Modifying the output file name -By default, the generated OpenAPI document will have the same name as the application's project file. To modify the name of the emitted file, set the `--file-name` argument in the `OpenApiGenerateDocumentsOptions` property. +By default, the generated OpenAPI document will have the same name as the app's project file. To modify the name of the emitted file, set the `--file-name` argument in the `OpenApiGenerateDocumentsOptions` property. ```xml @@ -208,7 +228,7 @@ By default, the generated OpenAPI document will have the same name as the applic #### Selecting the OpenAPI document to generate -Some applications may be configured to emit multiple OpenAPI documents, for various versions of an API or to distinguish between public and internal APIs. By default, the build-time document generator will emit files for all documents that are configured in an application. To only emit for a single document name, set the `--document-name` argument in the `OpenApiGenerateDocumentsOptions` property. +Some apps may be configured to emit multiple OpenAPI documents. Multiple OpenAPI documents may be generated for different versions of an API or to distinguish between public and internal APIs. By default, the build-time document generator emits files for all documents that are configured in an app. To only emit for a single document name, set the `--document-name` argument in the `OpenApiGenerateDocumentsOptions` property. ```xml diff --git a/aspnetcore/fundamentals/servers/yarp/getting-started.md b/aspnetcore/fundamentals/servers/yarp/getting-started.md index 740314ad5e3b..ae8f4d9a1d1d 100644 --- a/aspnetcore/fundamentals/servers/yarp/getting-started.md +++ b/aspnetcore/fundamentals/servers/yarp/getting-started.md @@ -4,7 +4,7 @@ title: YARP Getting Started with YARP description: YARP Getting Started with YARP author: samsp-msft ms.author: samsp -ms.date: 2/6/2025 +ms.date: 3/6/2025 ms.topic: article content_well_notification: AI-contribution ai-usage: ai-assisted @@ -12,43 +12,41 @@ ai-usage: ai-assisted # Getting Started with YARP -YARP is designed as a library that provides the core proxy functionality which you can then customize by adding or replacing modules. -YARP is currently provided as a NuGet package and code snippets. -We plan on providing a project template and pre-built exe in the future. +YARP is designed as a library that provides the core proxy functionality which you can then customize by adding or replacing modules. YARP is currently provided as a NuGet package and code snippets. We plan on providing a project template and prebuilt executable (`.exe`) in the future. -YARP is implemented on top of .NET Core infrastructure and is usable on Windows, Linux or MacOS. -Development can be done with the SDK and your favorite editor, [Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/) or [Visual Studio Code](https://code.visualstudio.com/). +YARP is implemented on top of .NET Core infrastructure and is usable on Windows, Linux or MacOS. Development can be done with the SDK and your favorite editor, [Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/) or [Visual Studio Code](https://code.visualstudio.com/). -YARP 2.1.0 supports ASP.NET Core 6.0 and newer, including ASP.NET Core 8.0. -You can download the .NET SDK from https://dotnet.microsoft.com/download/dotnet/. +YARP 2.3.0 supports ASP.NET Core 8.0 and newer. -Visual Studio support for .NET 8 is included in Visual Studio 2022 17.8. +You can download the .NET SDK from https://dotnet.microsoft.com/download/dotnet/. -### Create a new project +## Create a new project A complete version of the project built using the steps below can be found at [Basic YARP Sample](https://github.com/microsoft/reverse-proxy/tree/release/latest/samples/BasicYarpSample). Start by creating an "Empty" ASP.NET Core application using the command line: -```Console -dotnet new web -n MyProxy -f net8.0 +```dotnetcli +dotnet new web -n MyProxy ``` -Or create a new ASP.NET Core web application in Visual Studio 2022, and choose "Empty" for the project template. +Alternatively, create a new ASP.NET Core web application in Visual Studio 2022, choosing "Empty" for the project template. + +## Add the package reference -### Add the project reference +Add a package reference for [`Yarp.ReverseProxy`](https://www.nuget.org/packages/Yarp.ReverseProxy), version 2.3.0 or later. - ```XML - - - +```dotnetcli +dotnet add package Yarp.ReverseProxy ``` -### Add the YARP Middleware +[!INCLUDE[](~/includes/package-reference.md)] -Update Program.cs to use the YARP middleware: +## Add the YARP Middleware -```C# +Update the `Program` file to use the YARP Middleware: + +```csharp var builder = WebApplication.CreateBuilder(args); builder.Services.AddReverseProxy() .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy")); @@ -59,13 +57,13 @@ app.Run(); ## Configuration -The configuration for YARP is defined in the appsettings.json file. See [Configuration Files](xref:fundamentals/servers/yarp/config-files) for details. +The configuration for YARP is defined in the `appsettings.json` file. For more information, see . -The configuration can also be provided programmatically. See [Configuration Providers](xref:fundamentals/servers/yarp/config-providers) for details. +The configuration can also be provided programmatically. For more information, see . -You can find out more about the available configuration options by looking at [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig) and [ClusterConfig](xref:Yarp.ReverseProxy.Configuration.ClusterConfig). +Learn more about the available configuration options by looking at and . - ```JSON + ```json { "Logging": { "LogLevel": { @@ -97,6 +95,8 @@ You can find out more about the available configuration options by looking at [R } ``` -### Running the project +## Run the project + +When using the .NET CLU, use `dotnet run` called within the sample's directory or `dotnet run --project `. -Use `dotnet run` called within the sample's directory or `dotnet run --project ` +In Visual Studio, start the app with the **Run** button. diff --git a/aspnetcore/fundamentals/url-rewriting/_static/add_redirect_to_https6.png b/aspnetcore/fundamentals/url-rewriting/_static/add_redirect_to_https6.png index 56a2404e7f32..3259f90b3286 100644 Binary files a/aspnetcore/fundamentals/url-rewriting/_static/add_redirect_to_https6.png and b/aspnetcore/fundamentals/url-rewriting/_static/add_redirect_to_https6.png differ diff --git a/aspnetcore/grpc/aspnetcore.md b/aspnetcore/grpc/aspnetcore.md index 66c9a0687ba8..fa64c06da4c1 100644 --- a/aspnetcore/grpc/aspnetcore.md +++ b/aspnetcore/grpc/aspnetcore.md @@ -153,17 +153,31 @@ For more information about using the `Microsoft.AspNetCore.App` framework refere ## Integration with ASP.NET Core APIs -gRPC services have full access to the ASP.NET Core features such as [Dependency Injection](xref:fundamentals/dependency-injection) (DI) and [Logging](xref:fundamentals/logging/index). For example, the service implementation can resolve a logger service from the DI container via the constructor: +gRPC services have full access to the ASP.NET Core features such as [dependency injection](xref:fundamentals/dependency-injection) (DI) and [logging](xref:fundamentals/logging/index). For example, the service implementation can resolve a logger service from the DI container. + +Constructor injection: ```csharp public class GreeterService : Greeter.GreeterBase { + private readonly ILogger _logger; + public GreeterService(ILogger logger) { + _logger = logger; } } ``` +Primary constructor injection (.NET 8 or later): + +```csharp +public class GreeterService(ILogger logger) : Greeter.GreeterBase +{ + ... +} +``` + By default, the gRPC service implementation can resolve other DI services with any lifetime (Singleton, Scoped, or Transient). ### Resolve HttpContext in gRPC methods diff --git a/aspnetcore/grpc/index.md b/aspnetcore/grpc/index.md index 213234e9fc37..f26f4b949ee9 100644 --- a/aspnetcore/grpc/index.md +++ b/aspnetcore/grpc/index.md @@ -14,6 +14,7 @@ uid: grpc/index By [James Newton-King](https://twitter.com/jamesnk) :::moniker range=">= aspnetcore-6.0" + [gRPC](https://grpc.io) is a language agnostic, high-performance Remote Procedure Call (RPC) framework. The main benefits of gRPC are: @@ -73,6 +74,30 @@ gRPC requires the [Grpc.AspNetCore](https://www.nuget.org/packages/Grpc.AspNetCo The **ASP.NET Core gRPC Service** project template provides a starter service: +:::moniker-end + +:::moniker range=">= aspnetcore-10.0" + +```csharp +public class GreeterService(ILogger logger) : Greeter.GreeterBase +{ + public override Task SayHello(HelloRequest request, + ServerCallContext context) + { + logger.LogInformation("Saying hello to {Name}", request.Name); + + return Task.FromResult(new HelloReply + { + Message = "Hello " + request.Name + }); + } +} +``` + +:::moniker-end + +:::moniker range=">= aspnetcore-6.0 < aspnetcore-10.0" + ```csharp public class GreeterService : Greeter.GreeterBase { @@ -87,6 +112,7 @@ public class GreeterService : Greeter.GreeterBase ServerCallContext context) { _logger.LogInformation("Saying hello to {Name}", request.Name); + return Task.FromResult(new HelloReply { Message = "Hello " + request.Name @@ -95,6 +121,10 @@ public class GreeterService : Greeter.GreeterBase } ``` +:::moniker-end + +:::moniker range=">= aspnetcore-6.0" + `GreeterService` inherits from the `GreeterBase` type, which is generated from the `Greeter` service in the `.proto` file. The service is made accessible to clients in `Program.cs`: ```csharp @@ -132,6 +162,7 @@ For more information on creating clients, and calling different service methods, :::moniker-end :::moniker range=">= aspnetcore-3.0 < aspnetcore-6.0" + [gRPC](https://grpc.io) is a language agnostic, high-performance Remote Procedure Call (RPC) framework. The main benefits of gRPC are: diff --git a/aspnetcore/grpc/migration.md b/aspnetcore/grpc/migration.md index e0da15781c07..ce68ea96d578 100644 --- a/aspnetcore/grpc/migration.md +++ b/aspnetcore/grpc/migration.md @@ -86,17 +86,31 @@ For more information on configuration, see . ## Logging -C-core-based apps rely on the `GrpcEnvironment` to [configure the logger](https://grpc.io/grpc/csharp/api/Grpc.Core.GrpcEnvironment.html?q=size#Grpc_Core_GrpcEnvironment_SetLogger_Grpc_Core_Logging_ILogger_) for debugging purposes. The ASP.NET Core stack provides this functionality through the [Logging API](xref:fundamentals/logging/index). For example, a logger can be added to the gRPC service via constructor injection: +C-core-based apps rely on the `GrpcEnvironment` to [configure the logger](https://grpc.io/grpc/csharp/api/Grpc.Core.GrpcEnvironment.html?q=size#Grpc_Core_GrpcEnvironment_SetLogger_Grpc_Core_Logging_ILogger_) for debugging purposes. The ASP.NET Core stack provides this functionality through the [Logging API](xref:fundamentals/logging/index). For example, a logger can be added to the gRPC service. + +Constructor injection: ```csharp public class GreeterService : Greeter.GreeterBase { + private readonly ILogger _logger; + public GreeterService(ILogger logger) { + _logger = logger; } } ``` +Primary constructor injection (.NET 8 or later): + +```csharp +public class GreeterService(ILogger logger) : Greeter.GreeterBase +{ + ... +} +``` + For more information on gRPC logging and diagnostics, see . ## HTTPS diff --git a/aspnetcore/grpc/troubleshoot/sample/8.0/GrpcGreeter/Services/GreeterService.cs b/aspnetcore/grpc/troubleshoot/sample/8.0/GrpcGreeter/Services/GreeterService.cs index c091ece55a51..d07eae5ad7ae 100644 --- a/aspnetcore/grpc/troubleshoot/sample/8.0/GrpcGreeter/Services/GreeterService.cs +++ b/aspnetcore/grpc/troubleshoot/sample/8.0/GrpcGreeter/Services/GreeterService.cs @@ -6,6 +6,7 @@ namespace GrpcGreeter.Services public class GreeterService : Greeter.GreeterBase { private readonly ILogger _logger; + public GreeterService(ILogger logger) { _logger = logger; diff --git a/aspnetcore/migration/web_forms.md b/aspnetcore/migration/web_forms.md index 4a297b359f53..d1a5e34c3a58 100644 --- a/aspnetcore/migration/web_forms.md +++ b/aspnetcore/migration/web_forms.md @@ -3,14 +3,14 @@ title: Learn to upgrade from ASP.NET Web Forms to ASP.NET Core description: Learn how to upgrade an ASP.NET Web Forms project to ASP.NET Core author: rick-anderson ms.author: riande -ms.date: 03/07/2017 +ms.date: 3/1/2025 uid: migration/web_forms --- -# Upgrade an ASP.NET Framework Web Forms app to ASP.NET Core MVC +# Upgrade an ASP.NET Framework Web Forms app to ASP.NET Core :::moniker range=">= aspnetcore-7.0" -This article shows how to upgrade an ASP.NET Framework Web Forms to ASP.NET Core MVC using the Visual Studio [.NET Upgrade Assistant](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.upgradeassistant) and the [incremental update](xref:migration/inc/overview) approach. +This article shows how to upgrade an ASP.NET Framework Web Forms to ASP.NET Core using the Visual Studio [.NET Upgrade Assistant](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.upgradeassistant) and the [incremental update](xref:migration/inc/overview) approach. If your .NET Framework project has supporting libraries in its solution that are required, they should be upgraded to .NET Standard 2.0, if possible. For more information, see [Upgrade supporting libraries](/aspnet/core/migration/inc/start#upgrade-supporting-libraries). @@ -22,7 +22,6 @@ If your .NET Framework project has supporting libraries in its solution that are 1. Select the target framework version and then select **Next**. For more information, see [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core). 1. Select **Done**, then select **Finish**. 1. The **Summary** step displays **`` is now connected to `` via Yarp proxy.**. -1. Select the component to upgrade, then select **Upgrade selection**. ## Incremental update diff --git a/aspnetcore/release-notes/aspnetcore-10/includes/openApi.md b/aspnetcore/release-notes/aspnetcore-10/includes/openApi.md index 52bd15efac79..4c4deef567d8 100644 --- a/aspnetcore/release-notes/aspnetcore-10/includes/openApi.md +++ b/aspnetcore/release-notes/aspnetcore-10/includes/openApi.md @@ -52,7 +52,7 @@ options.AddSchemaTransformer((schema, context, cancellationToken) => - ["temperatureF"] = new OpenApiInteger(32), + ["temperatureF"] = 32, - ["summary"] = new OpenApiString("Bracing"), -+ []"summary"] = "Bracing", ++ ["summary"] = "Bracing", }; } return Task.CompletedTask; diff --git a/aspnetcore/tutorials/first-mvc-app/adding-controller.md b/aspnetcore/tutorials/first-mvc-app/adding-controller.md index 8d5ff3e148a0..3f1af946c689 100644 --- a/aspnetcore/tutorials/first-mvc-app/adding-controller.md +++ b/aspnetcore/tutorials/first-mvc-app/adding-controller.md @@ -3,7 +3,7 @@ title: Part 2, add a controller to an ASP.NET Core MVC app author: wadepickett description: Part 2 of tutorial series on ASP.NET Core MVC. ms.author: wpickett -ms.date: 07/24/2024 +ms.date: 03/02/2025 monikerRange: '>= aspnetcore-3.1' uid: tutorials/first-mvc-app/adding-controller --- diff --git a/aspnetcore/tutorials/first-mvc-app/adding-controller/_static/ac.png b/aspnetcore/tutorials/first-mvc-app/adding-controller/_static/ac.png deleted file mode 100644 index 75169b70f20e..000000000000 Binary files a/aspnetcore/tutorials/first-mvc-app/adding-controller/_static/ac.png and /dev/null differ diff --git a/aspnetcore/tutorials/first-mvc-app/adding-model.md b/aspnetcore/tutorials/first-mvc-app/adding-model.md index 7f92cba91bcb..67de368af2f1 100644 --- a/aspnetcore/tutorials/first-mvc-app/adding-model.md +++ b/aspnetcore/tutorials/first-mvc-app/adding-model.md @@ -4,7 +4,7 @@ author: wadepickett description: Part 4 of tutorial series on ASP.NET Core MVC. monikerRange: '>= aspnetcore-3.1' ms.author: wpickett -ms.date: 2/20/2025 +ms.date: 03/02/2025 uid: tutorials/first-mvc-app/adding-model --- diff --git a/aspnetcore/tutorials/first-mvc-app/adding-view.md b/aspnetcore/tutorials/first-mvc-app/adding-view.md index a1f56e74b75a..d72040788d36 100644 --- a/aspnetcore/tutorials/first-mvc-app/adding-view.md +++ b/aspnetcore/tutorials/first-mvc-app/adding-view.md @@ -3,7 +3,7 @@ title: Part 3, add a view to an ASP.NET Core MVC app author: wadepickett description: Part 3 of tutorial series on ASP.NET Core MVC. ms.author: wpickett -ms.date: 07/24/2024 +ms.date: 03/02/2025 monikerRange: '>= aspnetcore-3.1' uid: tutorials/first-mvc-app/adding-view --- diff --git a/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/hello90.png b/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/hello90.png index 8da360948f49..76c6b464e918 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/hello90.png and b/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/hello90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/hello_template90.png b/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/hello_template90.png index 44a01a05188a..d8ab9a6ba1c6 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/hello_template90.png and b/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/hello_template90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/privacy90.png b/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/privacy90.png index 39f769cf3c89..71a765519652 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/privacy90.png and b/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/privacy90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/rick2_90.png b/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/rick2_90.png index 0f589facee7b..21bcadf7c4b0 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/rick2_90.png and b/aspnetcore/tutorials/first-mvc-app/adding-view/_static/9/rick2_90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/controller-methods-views.md b/aspnetcore/tutorials/first-mvc-app/controller-methods-views.md index 913018388f84..2641de413811 100644 --- a/aspnetcore/tutorials/first-mvc-app/controller-methods-views.md +++ b/aspnetcore/tutorials/first-mvc-app/controller-methods-views.md @@ -4,7 +4,7 @@ author: wadepickett description: Part 6, add a model to an ASP.NET Core MVC app monikerRange: '>= aspnetcore-3.1' ms.author: wpickett -ms.date: 07/24/2024 +ms.date: 03/02/2025 uid: tutorials/first-mvc-app/controller-methods-views --- diff --git a/aspnetcore/tutorials/first-mvc-app/controller-methods-views/_static/9/edit90.png b/aspnetcore/tutorials/first-mvc-app/controller-methods-views/_static/9/edit90.png index ba973405eca2..83c4b1e3a476 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/controller-methods-views/_static/9/edit90.png and b/aspnetcore/tutorials/first-mvc-app/controller-methods-views/_static/9/edit90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/controller-methods-views/_static/9/val90.png b/aspnetcore/tutorials/first-mvc-app/controller-methods-views/_static/9/val90.png index 831f24ded3ac..78f05bd9b610 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/controller-methods-views/_static/9/val90.png and b/aspnetcore/tutorials/first-mvc-app/controller-methods-views/_static/9/val90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/details.md b/aspnetcore/tutorials/first-mvc-app/details.md index 482288cb083a..a5b8e88de11e 100644 --- a/aspnetcore/tutorials/first-mvc-app/details.md +++ b/aspnetcore/tutorials/first-mvc-app/details.md @@ -4,7 +4,7 @@ author: wadepickett description: Part 10 of tutorial series on ASP.NET Core MVC. monikerRange: '>= aspnetcore-3.1' ms.author: wpickett -ms.date: 08/04/2024 +ms.date: 03/02/2025 uid: tutorials/first-mvc-app/details --- diff --git a/aspnetcore/tutorials/first-mvc-app/new-field.md b/aspnetcore/tutorials/first-mvc-app/new-field.md index ab4a39fba658..ad14a1fc4b10 100644 --- a/aspnetcore/tutorials/first-mvc-app/new-field.md +++ b/aspnetcore/tutorials/first-mvc-app/new-field.md @@ -4,7 +4,7 @@ author: wadepickett description: Part 8 of tutorial series on ASP.NET Core MVC. monikerRange: '>= aspnetcore-3.1' ms.author: wpickett -ms.date: 07/24/2024 +ms.date: 03/02/2025 uid: tutorials/first-mvc-app/new-field --- # Part 8, add a new field to an ASP.NET Core MVC app diff --git a/aspnetcore/tutorials/first-mvc-app/search.md b/aspnetcore/tutorials/first-mvc-app/search.md index 094f51fceb95..626abd967696 100644 --- a/aspnetcore/tutorials/first-mvc-app/search.md +++ b/aspnetcore/tutorials/first-mvc-app/search.md @@ -4,7 +4,7 @@ author: wadepickett description: Part 7 of tutorial series on ASP.NET Core MVC. monikerRange: '>= aspnetcore-3.1' ms.author: wpickett -ms.date: 01/26/2025 +ms.date: 03/02/2025 uid: tutorials/first-mvc-app/search --- diff --git a/aspnetcore/tutorials/first-mvc-app/search/_static/9/f12_form90.png b/aspnetcore/tutorials/first-mvc-app/search/_static/9/f12_form90.png index 498218126d4e..2ae9986718d5 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/search/_static/9/f12_form90.png and b/aspnetcore/tutorials/first-mvc-app/search/_static/9/f12_form90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/search/_static/9/f12_general90.png b/aspnetcore/tutorials/first-mvc-app/search/_static/9/f12_general90.png index a5667040a9ae..ebcb0148551e 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/search/_static/9/f12_general90.png and b/aspnetcore/tutorials/first-mvc-app/search/_static/9/f12_general90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/search/_static/9/filter90.png b/aspnetcore/tutorials/first-mvc-app/search/_static/9/filter90.png index 67daaa391e5f..45541a9dbc06 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/search/_static/9/filter90.png and b/aspnetcore/tutorials/first-mvc-app/search/_static/9/filter90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/search/_static/9/ghost2_90.png b/aspnetcore/tutorials/first-mvc-app/search/_static/9/ghost2_90.png index 83f3127b432d..2a05974aa462 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/search/_static/9/ghost2_90.png and b/aspnetcore/tutorials/first-mvc-app/search/_static/9/ghost2_90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/search/_static/9/ghost90.png b/aspnetcore/tutorials/first-mvc-app/search/_static/9/ghost90.png index 23408b3c0329..d7fcabf94aa9 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/search/_static/9/ghost90.png and b/aspnetcore/tutorials/first-mvc-app/search/_static/9/ghost90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/search/_static/9/search2_90.png b/aspnetcore/tutorials/first-mvc-app/search/_static/9/search2_90.png index 47b589b57b12..2886fab747b4 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/search/_static/9/search2_90.png and b/aspnetcore/tutorials/first-mvc-app/search/_static/9/search2_90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/search/_static/9/search_get90.png b/aspnetcore/tutorials/first-mvc-app/search/_static/9/search_get90.png index 7ffb4f3c4455..6db6107023ae 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/search/_static/9/search_get90.png and b/aspnetcore/tutorials/first-mvc-app/search/_static/9/search_get90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/start-mvc.md b/aspnetcore/tutorials/first-mvc-app/start-mvc.md index 2eca71dbbe55..07efaea4b7e4 100644 --- a/aspnetcore/tutorials/first-mvc-app/start-mvc.md +++ b/aspnetcore/tutorials/first-mvc-app/start-mvc.md @@ -4,7 +4,7 @@ author: wadepickett description: Learn how to get started with ASP.NET Core MVC. monikerRange: '>= aspnetcore-3.1' ms.author: wpickett -ms.date: 07/24/2024 +ms.date: 03/02/2025 uid: tutorials/first-mvc-app/start-mvc --- # Get started with ASP.NET Core MVC @@ -57,7 +57,7 @@ See https://github.com/dotnet/AspNetCore.Docs/issues/21193 * The **Location** for the project can be set to anywhere. * Select **Next**. * In the **Additional information** dialog: - * Select **.NET 9.0**. + * Select **.NET 9.0 (Standard Term Support)**. * Verify that **Do not use top-level statements** is unchecked. * Select **Create**. diff --git a/aspnetcore/tutorials/first-mvc-app/start-mvc/_static/9/additional-info-vs22-17.11.0.png b/aspnetcore/tutorials/first-mvc-app/start-mvc/_static/9/additional-info-vs22-17.11.0.png index d02659b1775d..90db0879cf2b 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/start-mvc/_static/9/additional-info-vs22-17.11.0.png and b/aspnetcore/tutorials/first-mvc-app/start-mvc/_static/9/additional-info-vs22-17.11.0.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/start-mvc/_static/9/home90-vs.png b/aspnetcore/tutorials/first-mvc-app/start-mvc/_static/9/home90-vs.png index 8361a5b34dd1..0bf4299eb5f6 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/start-mvc/_static/9/home90-vs.png and b/aspnetcore/tutorials/first-mvc-app/start-mvc/_static/9/home90-vs.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/start-mvc/sample/9.0-completed/Views/Shared/_Layout.cshtml b/aspnetcore/tutorials/first-mvc-app/start-mvc/sample/9.0-completed/Views/Shared/_Layout.cshtml index 377dc2b0fe82..45d56ac433b9 100644 --- a/aspnetcore/tutorials/first-mvc-app/start-mvc/sample/9.0-completed/Views/Shared/_Layout.cshtml +++ b/aspnetcore/tutorials/first-mvc-app/start-mvc/sample/9.0-completed/Views/Shared/_Layout.cshtml @@ -38,7 +38,7 @@ diff --git a/aspnetcore/tutorials/first-mvc-app/start-mvc/sample/MvcMovie90/Views/Shared/_Layout.cshtml b/aspnetcore/tutorials/first-mvc-app/start-mvc/sample/MvcMovie90/Views/Shared/_Layout.cshtml index 4ab577e61fd2..d8e75da91257 100644 --- a/aspnetcore/tutorials/first-mvc-app/start-mvc/sample/MvcMovie90/Views/Shared/_Layout.cshtml +++ b/aspnetcore/tutorials/first-mvc-app/start-mvc/sample/MvcMovie90/Views/Shared/_Layout.cshtml @@ -38,7 +38,7 @@ diff --git a/aspnetcore/tutorials/first-mvc-app/validation.md b/aspnetcore/tutorials/first-mvc-app/validation.md index a0a433efc154..7bedec577b56 100644 --- a/aspnetcore/tutorials/first-mvc-app/validation.md +++ b/aspnetcore/tutorials/first-mvc-app/validation.md @@ -4,7 +4,7 @@ author: wadepickett description: Part 9 of tutorial series on ASP.NET Core MVC. monikerRange: '>= aspnetcore-3.1' ms.author: wpickett -ms.date: 07/24/2024 +ms.date: 03/02/2025 uid: tutorials/first-mvc-app/validation --- diff --git a/aspnetcore/tutorials/first-mvc-app/validation/_static/9/val90.png b/aspnetcore/tutorials/first-mvc-app/validation/_static/9/val90.png index 6442b495d9f2..2851ab458e8d 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/validation/_static/9/val90.png and b/aspnetcore/tutorials/first-mvc-app/validation/_static/9/val90.png differ diff --git a/aspnetcore/tutorials/first-mvc-app/working-with-sql.md b/aspnetcore/tutorials/first-mvc-app/working-with-sql.md index 02fe2b0aa8d9..20dc2a32af89 100644 --- a/aspnetcore/tutorials/first-mvc-app/working-with-sql.md +++ b/aspnetcore/tutorials/first-mvc-app/working-with-sql.md @@ -3,7 +3,7 @@ title: Part 5, work with a database in an ASP.NET Core MVC app author: wadepickett description: Part 5 of tutorial series on ASP.NET Core MVC. ms.author: wpickett -ms.date: 07/24/2024 +ms.date: 03/02/2025 monikerRange: '>= aspnetcore-3.1' uid: tutorials/first-mvc-app/working-with-sql --- @@ -119,7 +119,7 @@ Test the app. Stop it and restart it so the `SeedData.Initialize` method runs an The app shows the seeded data. -![MVC Movie app open in Microsoft Edge showing movie data](~/tutorials/first-mvc-app/working-with-sql/_static/m80.png) +![MVC Movie app open in Microsoft Edge showing movie data](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90.png) > [!div class="step-by-step"] > [Previous: Adding a model](~/tutorials/first-mvc-app/adding-model.md) diff --git a/aspnetcore/tutorials/first-mvc-app/working-with-sql/_static/9/m90.png b/aspnetcore/tutorials/first-mvc-app/working-with-sql/_static/9/m90.png index c0af16e8f522..fecb8f044b3a 100644 Binary files a/aspnetcore/tutorials/first-mvc-app/working-with-sql/_static/9/m90.png and b/aspnetcore/tutorials/first-mvc-app/working-with-sql/_static/9/m90.png differ