Skip to content

Merge main into live #9952

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

Merged
merged 5 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 14 additions & 26 deletions .github/workflows/snippets5000.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# This is a basic workflow to help you get started with Actions
name: 'Snippets 5000'

# Controls when the action will run. Triggers the workflow on push or pull request
Expand All @@ -10,45 +9,41 @@ on:
workflow_dispatch:
inputs:
reason:
description: 'The reason for running the workflow'
description: 'Run Snippets 5000 to compile code'
required: true
default: 'Manual run'

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

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

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

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

# Print dotnet info
- name: Display .NET info
run: |
dotnet --info
# Clone docs tools repo
# Clone docs-tools repo
- name: Clone docs-tools repository
run: |
git clone https://github.com/dotnet/docs-tools
Expand All @@ -58,11 +53,4 @@ jobs:
env:
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
run: |
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 }}
# Update build output json file
- name: Upload build results
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #@v3.1.2
with:
name: build
path: ./output.json
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 }}
8 changes: 8 additions & 0 deletions snippets/csharp/System.Threading/Lock/Overview/Project.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<!-- CA2252: Opt in to preview features before using them (Lock) -->
<EnablePreviewFeatures>true</EnablePreviewFeatures>
</PropertyGroup>
</Project>
47 changes: 47 additions & 0 deletions snippets/csharp/System.Threading/Lock/Overview/UsagePatterns.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Threading;

static class Program
{
private static void Main()
{
var dataStructure = new ExampleDataStructure();
dataStructure.Modify();
}
}

// <Snippet1>
public sealed class ExampleDataStructure
{
private readonly Lock _lockObj = new();

public void Modify()
{
lock (_lockObj)
{
// Critical section associated with _lockObj
}

using (_lockObj.EnterScope())
{
// Critical section associated with _lockObj
}

_lockObj.Enter();
try
{
// Critical section associated with _lockObj
}
finally { _lockObj.Exit(); }

if (_lockObj.TryEnter())
{
try
{
// Critical section associated with _lockObj
}
finally { _lockObj.Exit(); }
}
}
}
// </Snippet1>
38 changes: 20 additions & 18 deletions xml/FrameworksIndex/net-6.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<Framework Name="net-6.0">
<Assemblies>
<Assembly Name="Microsoft.CSharp" Version="6.0.0.0" />
<Assembly Name="Microsoft.Extensions.AmbientMetadata.Application" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.AsyncState" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.AmbientMetadata.Application" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.AsyncState" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Caching.Memory" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Compliance.Abstractions" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Compliance.Redaction" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Compliance.Testing" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Compliance.Abstractions" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Compliance.Redaction" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Compliance.Testing" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Configuration.Binder" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0.0" />
Expand All @@ -20,17 +20,17 @@
<Assembly Name="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Configuration.Xml" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.DependencyInjection.AutoActivation" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.DependencyInjection.AutoActivation" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.DependencyInjection" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.DependencyInjection.Specification.Tests" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.DependencyModel" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.Abstractions" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.ExceptionSummarization" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.HealthChecks.Common" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.ResourceMonitoring" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.Testing" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.ExceptionSummarization" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.HealthChecks.Common" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.ResourceMonitoring" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Diagnostics.Testing" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.FileProviders.Abstractions" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.FileProviders.Composite" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0.0" />
Expand All @@ -39,9 +39,9 @@
<Assembly Name="Microsoft.Extensions.Hosting" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Http.Diagnostics" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Http.Diagnostics" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Http" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Http.Resilience" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Http.Resilience" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Logging.Configuration" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Logging.Console" Version="8.0.0.0" />
Expand All @@ -50,15 +50,15 @@
<Assembly Name="Microsoft.Extensions.Logging.EventLog" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Logging.EventSource" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Logging.TraceSource" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.ObjectPool.DependencyInjection" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.ObjectPool.DependencyInjection" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Options" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Primitives" Version="8.0.0.0" />
<Assembly Name="Microsoft.Extensions.Resilience" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Telemetry.Abstractions" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Telemetry" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.TimeProvider.Testing" Version="8.4.0.0" />
<Assembly Name="Microsoft.Extensions.Resilience" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Telemetry.Abstractions" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.Telemetry" Version="8.5.0.0" />
<Assembly Name="Microsoft.Extensions.TimeProvider.Testing" Version="8.5.0.0" />
<Assembly Name="Microsoft.VisualBasic.Core" Version="11.0.0.0" />
<Assembly Name="Microsoft.Win32.Primitives" Version="6.0.0.0" />
<Assembly Name="Microsoft.Win32.Registry.AccessControl" Version="8.0.0.0" />
Expand Down Expand Up @@ -3193,9 +3193,11 @@
</Type>
<Type Name="Microsoft.Extensions.Http.Resilience.HttpClientHedgingResiliencePredicates" Id="T:Microsoft.Extensions.Http.Resilience.HttpClientHedgingResiliencePredicates">
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpClientHedgingResiliencePredicates.IsTransient(Polly.Outcome{System.Net.Http.HttpResponseMessage})" />
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpClientHedgingResiliencePredicates.IsTransient(Polly.Outcome{System.Net.Http.HttpResponseMessage},System.Threading.CancellationToken)" />
</Type>
<Type Name="Microsoft.Extensions.Http.Resilience.HttpClientResiliencePredicates" Id="T:Microsoft.Extensions.Http.Resilience.HttpClientResiliencePredicates">
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpClientResiliencePredicates.IsTransient(Polly.Outcome{System.Net.Http.HttpResponseMessage})" />
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpClientResiliencePredicates.IsTransient(Polly.Outcome{System.Net.Http.HttpResponseMessage},System.Threading.CancellationToken)" />
</Type>
<Type Name="Microsoft.Extensions.Http.Resilience.HttpHedgingStrategyOptions" Id="T:Microsoft.Extensions.Http.Resilience.HttpHedgingStrategyOptions">
<Member Id="M:Microsoft.Extensions.Http.Resilience.HttpHedgingStrategyOptions.#ctor" />
Expand Down
Loading