Skip to content

Commit 9ebcc50

Browse files
authored
Merge pull request #9952 from dotnet/main
Merge main into live
2 parents ac51d02 + a72e375 commit 9ebcc50

File tree

540 files changed

+51883
-46170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+51883
-46170
lines changed

.github/workflows/snippets5000.yml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# This is a basic workflow to help you get started with Actions
21
name: 'Snippets 5000'
32

43
# Controls when the action will run. Triggers the workflow on push or pull request
@@ -10,45 +9,41 @@ on:
109
workflow_dispatch:
1110
inputs:
1211
reason:
13-
description: 'The reason for running the workflow'
12+
description: 'Run Snippets 5000 to compile code'
1413
required: true
1514
default: 'Manual run'
1615

1716
env:
18-
DOTNET_INSTALLER_CHANNEL: '8.0'
19-
DOTNET_DO_INSTALL: 'false' # True to install preview versions, False to use the pre-installed (released) SDK
17+
DOTNET_VERSION: '9.0.*'
18+
DOTNET_QUALITY: 'preview'
19+
DOTNET_DO_INSTALL: 'true' # To install a version of .NET not provided by the runner, set to true
2020
EnableNuGetPackageRestore: 'True'
21-
repo: 'dotnet-api-docs'
2221

23-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2422
jobs:
25-
# This workflow contains a single job called "snippets-build"
2623
snippets-build:
27-
# The type of runner that the job will run on
2824
runs-on: windows-2022
2925
permissions:
3026
statuses: write
3127

32-
# Steps represent a sequence of tasks that will be executed as part of the job
3328
steps:
34-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
35-
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #@v3.1.0
29+
# Check out the repository for the PR
30+
- name: Check out repository
31+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b #@v4.1.5
3632

3733
# Get the latest preview SDK (or sdk not installed by the runner)
38-
- name: Setup .NET SDK
34+
- name: Set up .NET SDK
3935
if: ${{ env.DOTNET_DO_INSTALL == 'true' }}
40-
run: |
41-
echo "Downloading dotnet-install.ps1"
42-
Invoke-WebRequest https://raw.githubusercontent.com/dotnet/install-scripts/master/src/dotnet-install.ps1 -OutFile dotnet-install.ps1
43-
echo "Installing dotnet version ${{ env.DOTNET_INSTALLER_CHANNEL }}"
44-
.\dotnet-install.ps1 -InstallDir "c:\program files\dotnet" -Channel "${{ env.DOTNET_INSTALLER_CHANNEL }}" -Quality preview
36+
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 #@4.0.0
37+
with:
38+
dotnet-version: ${{ env.DOTNET_VERSION }}
39+
dotnet-quality: ${{ env.DOTNET_QUALITY }}
4540

4641
# Print dotnet info
4742
- name: Display .NET info
4843
run: |
4944
dotnet --info
5045
51-
# Clone docs tools repo
46+
# Clone docs-tools repo
5247
- name: Clone docs-tools repository
5348
run: |
5449
git clone https://github.com/dotnet/docs-tools
@@ -58,11 +53,4 @@ jobs:
5853
env:
5954
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
6055
run: |
61-
dotnet run --project docs-tools\snippets5000\Snippets5000\Snippets5000.csproj -- --sourcepath "${{ github.workspace }}" --pullrequest ${{ github.event.number }} --owner ${{ github.repository_owner }} --repo ${{ github.event.repository.name }}
62-
63-
# Update build output json file
64-
- name: Upload build results
65-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #@v3.1.2
66-
with:
67-
name: build
68-
path: ./output.json
56+
dotnet run --project docs-tools/snippets5000/Snippets5000/Snippets5000.csproj -- --sourcepath "${{ github.workspace }}" --pullrequest ${{ github.event.number }} --owner ${{ github.repository_owner }} --repo ${{ github.event.repository.name }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<!-- CA2252: Opt in to preview features before using them (Lock) -->
6+
<EnablePreviewFeatures>true</EnablePreviewFeatures>
7+
</PropertyGroup>
8+
</Project>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System;
2+
using System.Threading;
3+
4+
static class Program
5+
{
6+
private static void Main()
7+
{
8+
var dataStructure = new ExampleDataStructure();
9+
dataStructure.Modify();
10+
}
11+
}
12+
13+
// <Snippet1>
14+
public sealed class ExampleDataStructure
15+
{
16+
private readonly Lock _lockObj = new();
17+
18+
public void Modify()
19+
{
20+
lock (_lockObj)
21+
{
22+
// Critical section associated with _lockObj
23+
}
24+
25+
using (_lockObj.EnterScope())
26+
{
27+
// Critical section associated with _lockObj
28+
}
29+
30+
_lockObj.Enter();
31+
try
32+
{
33+
// Critical section associated with _lockObj
34+
}
35+
finally { _lockObj.Exit(); }
36+
37+
if (_lockObj.TryEnter())
38+
{
39+
try
40+
{
41+
// Critical section associated with _lockObj
42+
}
43+
finally { _lockObj.Exit(); }
44+
}
45+
}
46+
}
47+
// </Snippet1>

xml/FrameworksIndex/net-6.0.xml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<Framework Name="net-6.0">
33
<Assemblies>
44
<Assembly Name="Microsoft.CSharp" Version="6.0.0.0" />
5-
<Assembly Name="Microsoft.Extensions.AmbientMetadata.Application" Version="8.4.0.0" />
6-
<Assembly Name="Microsoft.Extensions.AsyncState" Version="8.4.0.0" />
5+
<Assembly Name="Microsoft.Extensions.AmbientMetadata.Application" Version="8.5.0.0" />
6+
<Assembly Name="Microsoft.Extensions.AsyncState" Version="8.5.0.0" />
77
<Assembly Name="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0.0" />
88
<Assembly Name="Microsoft.Extensions.Caching.Memory" Version="8.0.0.0" />
9-
<Assembly Name="Microsoft.Extensions.Compliance.Abstractions" Version="8.4.0.0" />
10-
<Assembly Name="Microsoft.Extensions.Compliance.Redaction" Version="8.4.0.0" />
11-
<Assembly Name="Microsoft.Extensions.Compliance.Testing" Version="8.4.0.0" />
9+
<Assembly Name="Microsoft.Extensions.Compliance.Abstractions" Version="8.5.0.0" />
10+
<Assembly Name="Microsoft.Extensions.Compliance.Redaction" Version="8.5.0.0" />
11+
<Assembly Name="Microsoft.Extensions.Compliance.Testing" Version="8.5.0.0" />
1212
<Assembly Name="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0.0" />
1313
<Assembly Name="Microsoft.Extensions.Configuration.Binder" Version="8.0.0.0" />
1414
<Assembly Name="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0.0" />
@@ -20,17 +20,17 @@
2020
<Assembly Name="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0.0" />
2121
<Assembly Name="Microsoft.Extensions.Configuration.Xml" Version="8.0.0.0" />
2222
<Assembly Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0.0" />
23-
<Assembly Name="Microsoft.Extensions.DependencyInjection.AutoActivation" Version="8.4.0.0" />
23+
<Assembly Name="Microsoft.Extensions.DependencyInjection.AutoActivation" Version="8.5.0.0" />
2424
<Assembly Name="Microsoft.Extensions.DependencyInjection" Version="8.0.0.0" />
2525
<Assembly Name="Microsoft.Extensions.DependencyInjection.Specification.Tests" Version="8.0.0.0" />
2626
<Assembly Name="Microsoft.Extensions.DependencyModel" Version="8.0.0.0" />
2727
<Assembly Name="Microsoft.Extensions.Diagnostics.Abstractions" Version="8.0.0.0" />
2828
<Assembly Name="Microsoft.Extensions.Diagnostics" Version="8.0.0.0" />
29-
<Assembly Name="Microsoft.Extensions.Diagnostics.ExceptionSummarization" Version="8.4.0.0" />
30-
<Assembly Name="Microsoft.Extensions.Diagnostics.HealthChecks.Common" Version="8.4.0.0" />
31-
<Assembly Name="Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization" Version="8.4.0.0" />
32-
<Assembly Name="Microsoft.Extensions.Diagnostics.ResourceMonitoring" Version="8.4.0.0" />
33-
<Assembly Name="Microsoft.Extensions.Diagnostics.Testing" Version="8.4.0.0" />
29+
<Assembly Name="Microsoft.Extensions.Diagnostics.ExceptionSummarization" Version="8.5.0.0" />
30+
<Assembly Name="Microsoft.Extensions.Diagnostics.HealthChecks.Common" Version="8.5.0.0" />
31+
<Assembly Name="Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization" Version="8.5.0.0" />
32+
<Assembly Name="Microsoft.Extensions.Diagnostics.ResourceMonitoring" Version="8.5.0.0" />
33+
<Assembly Name="Microsoft.Extensions.Diagnostics.Testing" Version="8.5.0.0" />
3434
<Assembly Name="Microsoft.Extensions.FileProviders.Abstractions" Version="8.0.0.0" />
3535
<Assembly Name="Microsoft.Extensions.FileProviders.Composite" Version="8.0.0.0" />
3636
<Assembly Name="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0.0" />
@@ -39,9 +39,9 @@
3939
<Assembly Name="Microsoft.Extensions.Hosting" Version="8.0.0.0" />
4040
<Assembly Name="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0.0" />
4141
<Assembly Name="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0.0" />
42-
<Assembly Name="Microsoft.Extensions.Http.Diagnostics" Version="8.4.0.0" />
42+
<Assembly Name="Microsoft.Extensions.Http.Diagnostics" Version="8.5.0.0" />
4343
<Assembly Name="Microsoft.Extensions.Http" Version="8.0.0.0" />
44-
<Assembly Name="Microsoft.Extensions.Http.Resilience" Version="8.4.0.0" />
44+
<Assembly Name="Microsoft.Extensions.Http.Resilience" Version="8.5.0.0" />
4545
<Assembly Name="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0.0" />
4646
<Assembly Name="Microsoft.Extensions.Logging.Configuration" Version="8.0.0.0" />
4747
<Assembly Name="Microsoft.Extensions.Logging.Console" Version="8.0.0.0" />
@@ -50,15 +50,15 @@
5050
<Assembly Name="Microsoft.Extensions.Logging.EventLog" Version="8.0.0.0" />
5151
<Assembly Name="Microsoft.Extensions.Logging.EventSource" Version="8.0.0.0" />
5252
<Assembly Name="Microsoft.Extensions.Logging.TraceSource" Version="8.0.0.0" />
53-
<Assembly Name="Microsoft.Extensions.ObjectPool.DependencyInjection" Version="8.4.0.0" />
53+
<Assembly Name="Microsoft.Extensions.ObjectPool.DependencyInjection" Version="8.5.0.0" />
5454
<Assembly Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0.0" />
5555
<Assembly Name="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0.0" />
5656
<Assembly Name="Microsoft.Extensions.Options" Version="8.0.0.0" />
5757
<Assembly Name="Microsoft.Extensions.Primitives" Version="8.0.0.0" />
58-
<Assembly Name="Microsoft.Extensions.Resilience" Version="8.4.0.0" />
59-
<Assembly Name="Microsoft.Extensions.Telemetry.Abstractions" Version="8.4.0.0" />
60-
<Assembly Name="Microsoft.Extensions.Telemetry" Version="8.4.0.0" />
61-
<Assembly Name="Microsoft.Extensions.TimeProvider.Testing" Version="8.4.0.0" />
58+
<Assembly Name="Microsoft.Extensions.Resilience" Version="8.5.0.0" />
59+
<Assembly Name="Microsoft.Extensions.Telemetry.Abstractions" Version="8.5.0.0" />
60+
<Assembly Name="Microsoft.Extensions.Telemetry" Version="8.5.0.0" />
61+
<Assembly Name="Microsoft.Extensions.TimeProvider.Testing" Version="8.5.0.0" />
6262
<Assembly Name="Microsoft.VisualBasic.Core" Version="11.0.0.0" />
6363
<Assembly Name="Microsoft.Win32.Primitives" Version="6.0.0.0" />
6464
<Assembly Name="Microsoft.Win32.Registry.AccessControl" Version="8.0.0.0" />
@@ -3193,9 +3193,11 @@
31933193
</Type>
31943194
<Type Name="Microsoft.Extensions.Http.Resilience.HttpClientHedgingResiliencePredicates" Id="T:Microsoft.Extensions.Http.Resilience.HttpClientHedgingResiliencePredicates">
31953195
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpClientHedgingResiliencePredicates.IsTransient(Polly.Outcome{System.Net.Http.HttpResponseMessage})" />
3196+
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpClientHedgingResiliencePredicates.IsTransient(Polly.Outcome{System.Net.Http.HttpResponseMessage},System.Threading.CancellationToken)" />
31963197
</Type>
31973198
<Type Name="Microsoft.Extensions.Http.Resilience.HttpClientResiliencePredicates" Id="T:Microsoft.Extensions.Http.Resilience.HttpClientResiliencePredicates">
31983199
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpClientResiliencePredicates.IsTransient(Polly.Outcome{System.Net.Http.HttpResponseMessage})" />
3200+
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpClientResiliencePredicates.IsTransient(Polly.Outcome{System.Net.Http.HttpResponseMessage},System.Threading.CancellationToken)" />
31993201
</Type>
32003202
<Type Name="Microsoft.Extensions.Http.Resilience.HttpHedgingStrategyOptions" Id="T:Microsoft.Extensions.Http.Resilience.HttpHedgingStrategyOptions">
32013203
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpHedgingStrategyOptions.#ctor" />

0 commit comments

Comments
 (0)