Skip to content

Commit

Permalink
Merge pull request #33732 from dotnet/Rick-Anderson-patch-7
Browse files Browse the repository at this point in the history
Update configuration.md ropc
  • Loading branch information
Rick-Anderson authored Sep 28, 2024
2 parents 8b82fa6 + 5e84509 commit 9b7c3bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aspnetcore/migration/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ description: Learn how to migrate configuration from an ASP.NET MVC project to a
ms.author: riande
ms.date: 10/14/2016
uid: migration/configuration
ms.sfi.ropc: t
---
# Migrate configuration to ASP.NET Core

By [Steve Smith](https://ardalis.com/) and [Scott Addie](https://scottaddie.com)

In the previous article, we began to [migrate an ASP.NET MVC project to ASP.NET Core MVC](xref:migration/mvc). In this article, we migrate configuration.

[View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/migration/configuration/samples) ([how to download](xref:index#how-to-download-a-sample))
Expand All @@ -20,6 +19,8 @@ ASP.NET Core no longer uses the *Global.asax* and *web.config* files that previo

The *web.config* file has also been replaced in ASP.NET Core. Configuration itself can now be configured, as part of the application startup procedure described in `Startup.cs`. Configuration can still utilize XML files, but typically ASP.NET Core projects will place configuration values in a JSON-formatted file, such as `appsettings.json`. ASP.NET Core's configuration system can also easily access environment variables, which can provide a [more secure and robust location](xref:security/app-secrets) for environment-specific values. This is especially true for secrets like connection strings and API keys that shouldn't be checked into source control. See [Configuration](xref:fundamentals/configuration/index) to learn more about configuration in ASP.NET Core.

[!INCLUDE [managed-identities](~/includes/managed-identities-test-non-production.md)]

For this article, we are starting with the partially migrated ASP.NET Core project from [the previous article](xref:migration/mvc). To setup configuration, add the following constructor and property to the `Startup.cs` file located in the root of the project:

[!code-csharp[](configuration/samples/WebApp1/src/WebApp1/Startup.cs?range=11-16)]
Expand Down

0 comments on commit 9b7c3bf

Please sign in to comment.