Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into live #36337

Merged
merged 41 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6f4b6b7
Bump IronPython
dependabot[bot] Jul 19, 2023
6c95b7b
Bump MSTest.TestFramework
dependabot[bot] Jul 19, 2023
fe5c9ad
Merge pull request #36313 from dotnet/dependabot/nuget/docs/core/tuto…
github-actions[bot] Jul 19, 2023
b75e236
Bump MSTest.TestAdapter
dependabot[bot] Jul 19, 2023
cdcd214
Bump MSTest.TestAdapter
dependabot[bot] Jul 19, 2023
6ed7c59
Merge pull request #36311 from dotnet/dependabot/nuget/docs/csharp/ad…
github-actions[bot] Jul 19, 2023
a017514
Bump MSTest.TestAdapter
dependabot[bot] Jul 19, 2023
cdd55f6
Merge pull request #36317 from dotnet/dependabot/nuget/docs/core/tuto…
github-actions[bot] Jul 19, 2023
4ac75fc
Merge pull request #36314 from dotnet/dependabot/nuget/docs/csharp/ro…
github-actions[bot] Jul 19, 2023
fd6e615
Merge pull request #36312 from dotnet/dependabot/nuget/docs/core/tuto…
github-actions[bot] Jul 19, 2023
303ca3c
Bump MSTest.TestFramework
dependabot[bot] Jul 19, 2023
3b203d4
Merge pull request #36315 from dotnet/dependabot/nuget/docs/csharp/ro…
github-actions[bot] Jul 19, 2023
d3092da
Bump MSTest.TestFramework
dependabot[bot] Jul 19, 2023
55069d7
Merge pull request #36318 from dotnet/dependabot/nuget/docs/core/tuto…
github-actions[bot] Jul 19, 2023
7d238bd
Bump MSTest.TestAdapter
dependabot[bot] Jul 19, 2023
597efff
Bump MSTest.TestFramework
dependabot[bot] Jul 19, 2023
323b579
Merge pull request #36319 from dotnet/dependabot/nuget/docs/core/tuto…
github-actions[bot] Jul 19, 2023
3d64da7
Merge pull request #36321 from dotnet/dependabot/nuget/docs/core/test…
github-actions[bot] Jul 19, 2023
3c5eb01
Bump MSTest.TestAdapter
dependabot[bot] Jul 19, 2023
4e6a1c2
Merge pull request #36323 from dotnet/dependabot/nuget/samples/snippe…
github-actions[bot] Jul 19, 2023
233a3d3
Bump IronPython
dependabot[bot] Jul 19, 2023
da5b594
Bump MSTest.TestAdapter
dependabot[bot] Jul 19, 2023
43926d2
Merge pull request #36320 from dotnet/dependabot/nuget/docs/core/test…
github-actions[bot] Jul 19, 2023
2e9a6db
Merge pull request #36324 from dotnet/dependabot/nuget/samples/snippe…
github-actions[bot] Jul 19, 2023
101a01d
Bump MSTest.TestFramework
dependabot[bot] Jul 19, 2023
aa95b9e
Merge pull request #36322 from dotnet/dependabot/nuget/samples/snippe…
github-actions[bot] Jul 19, 2023
8b3ea7e
Bump MSTest.TestFramework
dependabot[bot] Jul 19, 2023
6211b1d
Bump MSTest.TestFramework
dependabot[bot] Jul 19, 2023
2667de4
Merge pull request #36316 from dotnet/dependabot/nuget/docs/core/tuto…
github-actions[bot] Jul 19, 2023
3b9b2a7
Bump MSTest.TestAdapter
dependabot[bot] Jul 19, 2023
a0cae9a
Merge pull request #36327 from dotnet/dependabot/nuget/docs/csharp/la…
github-actions[bot] Jul 19, 2023
2c02b0d
Merge pull request #36325 from dotnet/dependabot/nuget/docs/core/test…
github-actions[bot] Jul 19, 2023
c0ecd1b
Bump MSTest.TestFramework
dependabot[bot] Jul 19, 2023
df33dc9
Merge pull request #36326 from dotnet/dependabot/nuget/docs/core/test…
github-actions[bot] Jul 19, 2023
d48bb5d
Fix a small grammar issue (#36297)
333fred Jul 19, 2023
070270a
Removed the closing parenthesis, which would cause a build error if i…
aleksvujic Jul 19, 2023
7412c23
Update index.md (#36307)
lmorvan Jul 19, 2023
31836d3
Fix GCTriggered event ID (#36300)
gewarren Jul 19, 2023
5002061
Remove TLS 1.0 as a secure protocol (#36304)
gewarren Jul 19, 2023
a47c002
Added section about ConfigurationBuilder (#36328)
IEvangelist Jul 19, 2023
7a6eb16
Update package index with latest published versions (#36332)
azure-sdk Jul 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions docs/azure/includes/dotnet-all.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/azure/includes/dotnet-new.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Unless your app has a specific reason not to, you should use the new defaults. V

To disable older protocols, take one of the following actions:

* Disable older protocols, such as TLS 1.0, system-wide with the [Windows instructions](../../../../framework/network-programming/tls.md#configuring-schannel-protocols-in-the-windows-registry). It's currently enabled by default on all Windows versions.
* Disable older protocols, such as TLS 1.0, system-wide with the [Windows instructions](../../../../framework/network-programming/tls.md#configure-schannel-protocols-in-the-windows-registry). It's currently enabled by default on all Windows versions.
* Manually select which protocols you want to support in code as follows:

```csharp
Expand Down
31 changes: 23 additions & 8 deletions docs/core/extensions/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Configuration
description: Learn how to use the Configuration API to configure .NET applications. Explore various inbuilt configuration providers.
author: IEvangelist
ms.author: dapine
ms.date: 06/23/2023
ms.date: 07/19/2023
ms.topic: overview
---

Expand Down Expand Up @@ -32,9 +32,24 @@ Given one or more configuration sources, the <xref:Microsoft.Extensions.Configur

## Configure console apps

.NET console applications created using the [dotnet new](../tools/dotnet-new.md) command template or Visual Studio by default *do not* expose configuration capabilities. To add configuration in a new .NET console application, [add a package reference](../tools/dotnet-add-package.md) to [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting). Modify the *Program.cs* file to match the following code:
.NET console applications created using the [dotnet new](../tools/dotnet-new.md) command template or Visual Studio by default *don't* expose configuration capabilities. To add configuration in a new .NET console application, [add a package reference](../tools/dotnet-add-package.md) to [Microsoft.Extensions.Configuration](https://www.nuget.org/packages/Microsoft.Extensions.Configuration). This package is the foundation for configuration in .NET apps. It provides the <xref:Microsoft.Extensions.Configuration.ConfigurationBuilder> and related types.

:::code language="csharp" source="snippets/configuration/console/Program.cs" highlight="3":::
:::code source="snippets/configuration/console-basic-builder/Program.cs":::

The preceding code:

- Creates a new <xref:Microsoft.Extensions.Configuration.ConfigurationBuilder> instance.
- Adds an in-memory collection of key-value pairs to the configuration builder.
- Calls the <xref:Microsoft.Extensions.Configuration.ConfigurationBuilder.Build> method to create an <xref:Microsoft.Extensions.Configuration.IConfiguration> instance.
- Writes the value of the `SomeKey` key to the console.

While this example uses an in-memory configuration, there are many configuration providers available, exposing functionality for file-based, environment variables, command line arguments, and other configuration sources. For more information, see [Configuration providers in .NET](configuration-providers.md).

### Alternative hosting approach

Commonly, your apps will do more than just read configuration. They'll likely use dependency injection, logging, and other services. The [.NET Generic Host](generic-host.md) approach is recommended for apps that use these services. Instead, consider [adding a package reference](../tools/dotnet-add-package.md) to [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting). Modify the *Program.cs* file to match the following code:

:::code source="snippets/configuration/console/Program.cs" highlight="3":::

The <xref:Microsoft.Extensions.Hosting.Host.CreateApplicationBuilder(System.String[])?displayProperty=nameWithType> method provides default configuration for the app in the following order, from highest to lowest priority:

Expand Down Expand Up @@ -118,7 +133,7 @@ Consider an example _appsettings.json_ file:

Now, given this JSON file, here's an example consumption pattern using the configuration builder directly:

:::code language="csharp" source="snippets/configuration/console-raw/Program.cs" highlight="4-7,10":::
:::code source="snippets/configuration/console-raw/Program.cs" highlight="4-7,10":::

The preceding C# code:

Expand All @@ -129,9 +144,9 @@ The preceding C# code:

The `Settings` object is shaped as follows:

:::code language="csharp" source="snippets/configuration/console-raw/Settings.cs":::
:::code source="snippets/configuration/console-raw/Settings.cs":::

:::code language="csharp" source="snippets/configuration/console-raw/NestedSettings.cs":::
:::code source="snippets/configuration/console-raw/NestedSettings.cs":::

### Basic example with hosting

Expand All @@ -151,7 +166,7 @@ Add the _appsettings.json_ file at the root of the project with the following co

Replace the contents of the _Program.cs_ file with the following C# code:

:::code language="csharp" source="snippets/configuration/console-basic/Program.cs" highlight="5,8,11-13,16-18":::
:::code source="snippets/configuration/console-basic/Program.cs" highlight="5,8,11-13,16-18":::

When you run this application, the `Host.CreateApplicationBuilder` defines the behavior to discover the JSON configuration and expose it through the `IConfiguration` instance. From the `host` instance, you can ask the service provider for the `IConfiguration` instance and then ask it for values.

Expand All @@ -166,7 +181,7 @@ Consider the same _appsettings.json_ file contents from the previous example:

Replace the contents of the _Program.cs_ file with the following C# code:

:::code language="csharp" source="snippets/configuration/console-indexer/Program.cs" highlight="11-15,17-22":::
:::code source="snippets/configuration/console-indexer/Program.cs" highlight="11-15,17-22":::

The values are accessed using the indexer API where each key is a string, and the value is a string. Configuration supports properties, objects, arrays, and dictionaries.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.Extensions.Configuration;

var configuration = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string?>()
{
["SomeKey"] = "SomeValue"
})
.Build();

Console.WriteLine(configuration["SomeKey"]);

// Outputs:
// SomeValue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<RootNamespace>Console.Example</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion docs/core/versions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The third position of the SDK version number communicates both the minor and pat
| SDK patch | 5.0.0 | 5.0.101 | Runtime didn't change with this SDK patch. SDK patch bumps last digit in SDK patch. |
| Runtime and SDK patch | 5.0.1 | 5.0.102 | Runtime patch bumps Runtime patch number. SDK patch bumps last digit in SDK patch. |
| SDK feature change | 5.0.1 | 5.0.200 | Runtime patch didn't change. New SDK feature bumps first digit in SDK patch. |
| Runtime patch | 5.0.2 | 5.0.102 | Runtime patch bumps Runtime patch number. SDK doesn't change. |
| Runtime patch | 5.0.2 | 5.0.200 | Runtime patch bumps Runtime patch number. SDK doesn't change. |

From the preceding table you can see several policies:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="IronPython" Version="3.4.0" />
<PackageReference Include="IronPython" Version="3.4.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ The diagnostics are enabled if the element content is `true`, disabled if `false

**ReportIVTs** reports the following information when enabled:

1. Any inaccessible member diagnostics include their source assembly, if if different than the current assembly.
1. Any inaccessible member diagnostics include their source assembly, if different than the current assembly.
1. The compiler prints the assembly identity of the project being compiled, its assembly name and public key.
1. For every reference passed to the compiler, it prints;
1. The assembly identity of the reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.6.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.MSTest" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.MSTest" Version="1.1.1" />
Expand Down
Loading