Skip to content

Commit 8366cfa

Browse files
authored
Random improvements to config articles (#43273)
1 parent 09bfdc7 commit 8366cfa

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

docs/core/extensions/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.date: 08/13/2024
88

99
# Options pattern in .NET
1010

11-
The options pattern uses classes to provide strongly-typed access to groups of related settings. When [configuration settings](configuration.md) are isolated by scenario into separate classes, the app adheres to two important software engineering principles:
11+
The options pattern uses classes to provide strongly typed access to groups of related settings. When [configuration settings](configuration.md) are isolated by scenario into separate classes, the app adheres to two important software engineering principles:
1212

1313
- The [Interface Segregation Principle (ISP) or Encapsulation](../../architecture/modern-web-apps-azure/architectural-principles.md#encapsulation): Scenarios (classes) that depend on configuration settings depend only on the configuration settings that they use.
1414
- [Separation of Concerns](../../architecture/modern-web-apps-azure/architectural-principles.md#separation-of-concerns): Settings for different parts of the app aren't dependent or coupled with one another.

docs/core/runtime-config/index.md

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,21 @@ description: Learn how to configure the .NET runtime using configuration setting
44
ms.topic: conceptual
55
ms.date: 07/23/2021
66
---
7-
# .NET Runtime configuration settings
8-
9-
.NET 5+ (including .NET Core versions) supports the use of configuration files and environment variables to configure the behavior of .NET applications.
10-
11-
> [!NOTE]
12-
> The articles in this section concern configuration of the .NET Runtime itself. If you're migrating an app from .NET Framework to .NET and are looking for a replacement for the *app.config* file, or if you simply want a way to use custom configuration values in your .NET app, see the <xref:Microsoft.Extensions.Configuration.ConfigurationBuilder?displayProperty=fullName> class and [Configuration in .NET](../extensions/configuration.md).
13-
14-
Using these settings is an attractive option if:
15-
16-
- You don't own or control the source code for an application and therefore are unable to configure it programmatically.
17-
- Multiple instances of your application run at the same time on a single system, and you want to configure each for optimum performance.
7+
# .NET runtime configuration settings
188

199
.NET provides the following mechanisms for configuring behavior of the .NET runtime:
2010

21-
- The [runtimeconfig.json file](#runtimeconfigjson)
22-
- [MSBuild properties](#msbuild-properties)
23-
- [Environment variables](#environment-variables)
24-
25-
> [!TIP]
26-
> Configuring an option by using an environment variable applies the setting to all .NET apps. Configuring an option in the *runtimeconfig.json* or project file applies the setting to that application only.
11+
| Mechanism | Notes |
12+
|---------------------------------------------------|----------------------------------------|
13+
| The [runtimeconfig.json file](#runtimeconfigjson) | Applies the setting to a specific app. Use this file if multiple instances of your app run at the same time on a single system, and you want to configure each for optimum performance. |
14+
| [MSBuild properties](#msbuild-properties) | Applies the setting to a specific app. MSBuild properties take precedence over settings in *runtimeconfig.json*. |
15+
| [Environment variables](#environment-variables) | Applies the setting to all .NET apps. |
2716

2817
Some configuration values can also be set programmatically by calling the <xref:System.AppContext.SetSwitch%2A?displayProperty=nameWithType> method.
2918

19+
> [!NOTE]
20+
> The articles in this section concern configuration of the .NET runtime itself. If you're migrating an app from .NET Framework to .NET and are looking for a replacement for the *app.config* file, see [Modernize after upgrading to .NET](../porting/modernize.md#appconfig). For information about supplying custom configuration values to .NET apps, see [Configuration in .NET](../extensions/configuration.md).
21+
3022
The articles in this section of the documentation are organized by category, for example, [debugging](debugging-profiling.md) and [garbage collection](garbage-collector.md). Where applicable, configuration options are shown for *runtimeconfig.json* files, MSBuild properties, environment variables, and, for cross-reference, *app.config* files for .NET Framework projects.
3123

3224
## runtimeconfig.json
@@ -49,7 +41,7 @@ Specify runtime configuration options in the **configProperties** section of the
4941

5042
### Example [appname].runtimeconfig.json file
5143

52-
If you're placing the options in the output JSON file, nest them under the `runtimeOptions` property.
44+
If you're placing the options in the *output* JSON file, nest them under the `runtimeOptions` property.
5345

5446
```json
5547
{
@@ -72,7 +64,7 @@ If you're placing the options in the output JSON file, nest them under the `runt
7264

7365
### Example runtimeconfig.template.json file
7466

75-
If you're placing the options in the template JSON file, omit the `runtimeOptions` property.
67+
If you're placing the options in the *template* JSON file, **omit** the `runtimeOptions` property.
7668

7769
```json
7870
{

0 commit comments

Comments
 (0)