Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,61 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenAPI" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.GenAPI" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenFacades" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.GenFacades" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.5.1-beta.20474.4">
<Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.5.1-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk" Version="5.0.0-beta.20474.4">
<Dependency Name="Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk" Version="5.0.0-beta.20506.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>61cde6e8fb9d5c9790867b279deb41783a780cd8</Sha>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
</Dependency>
<Dependency Name="optimization.windows_nt-x64.IBC.CoreFx" Version="99.99.99-master-20200806.6">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
Expand Down
20 changes: 10 additions & 10 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@
</ItemGroup>
<PropertyGroup>
<!-- Arcade dependencies -->
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20474.4</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetBuildTasksFeedVersion>5.0.0-beta.20474.4</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.20474.4</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.20474.4</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>5.0.0-beta.20474.4</MicrosoftDotNetGenFacadesVersion>
<MicrosoftDotNetXUnitExtensionsVersion>5.0.0-beta.20474.4</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.20474.4</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>5.0.0-beta.20474.4</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.20474.4</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetVersionToolsTasksVersion>5.0.0-beta.20474.4</MicrosoftDotNetVersionToolsTasksVersion>
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20506.7</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetBuildTasksFeedVersion>5.0.0-beta.20506.7</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.20506.7</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.20506.7</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>5.0.0-beta.20506.7</MicrosoftDotNetGenFacadesVersion>
<MicrosoftDotNetXUnitExtensionsVersion>5.0.0-beta.20506.7</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.20506.7</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>5.0.0-beta.20506.7</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.20506.7</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetVersionToolsTasksVersion>5.0.0-beta.20506.7</MicrosoftDotNetVersionToolsTasksVersion>
<!-- Installer dependencies -->
<MicrosoftNETCoreAppVersion>5.0.0-preview.4.20202.18</MicrosoftNETCoreAppVersion>
<MicrosoftNETCoreDotNetHostVersion>5.0.0-preview.4.20202.18</MicrosoftNETCoreDotNetHostVersion>
Expand Down
12 changes: 11 additions & 1 deletion eng/common/templates/job/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:

- ${{ if eq(parameters.enablePublishTestResults, 'true') }}:
- task: PublishTestResults@2
displayName: Publish Test Results
displayName: Publish XUnit Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
Expand All @@ -213,6 +213,16 @@ jobs:
mergeTestResults: ${{ parameters.mergeTestResults }}
continueOnError: true
condition: always()
- task: PublishTestResults@2
displayName: Publish TRX Test Results
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
testRunTitle: ${{ coalesce(parameters.testRunTitle, parameters.name, '$(System.JobName)') }}-trx
mergeTestResults: ${{ parameters.mergeTestResults }}
continueOnError: true
condition: always()

- ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(parameters.enablePublishUsingPipelines, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: CopyFiles@2
Expand Down
2 changes: 1 addition & 1 deletion eng/common/templates/steps/perf-send-to-helix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:
WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects
CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload
IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion
DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
DotNetCliPackageType: '' # optional -- either 'sdk', 'runtime' or 'aspnetcore-runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control
WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget."
Expand Down
2 changes: 1 addition & 1 deletion eng/common/templates/steps/send-to-helix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parameters:
XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner
XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects
IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion
DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json
DotNetCliPackageType: '' # optional -- either 'sdk', 'runtime' or 'aspnetcore-runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json
DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json
EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control
WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget."
Expand Down
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"python3": "3.7.1"
},
"msbuild-sdks": {
"Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20474.4",
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20474.4",
"Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20474.4",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20474.4",
"Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20506.7",
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20506.7",
"Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20506.7",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20506.7",
"Microsoft.FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0",
"Microsoft.NET.Sdk.IL": "5.0.0-preview.8.20359.4",
"Microsoft.Build.NoTargets": "2.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ public static bool SetComObjectData(object obj, object key, object? data)
if (!SetComObjectData(o, t, Wrapper))
{
// Another thead already cached the wrapper so use that one instead.
Wrapper = GetComObjectData(o, t);
Wrapper = GetComObjectData(o, t)!;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void RetryOnIOError(Action func)

public static void RetryOnWin32Error(Action func)
{
bool IsKnownIrrecoverableError(int hresult)
static bool IsKnownIrrecoverableError(int hresult)
{
// Error codes are defined in winerror.h
// The error code is stored in the lowest 16 bits of the HResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static bool TryGetDefaultValue(ParameterInfo parameter, out object? defau

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2067:UnrecognizedReflectionPattern",
Justification = "CreateInstance is only called on a ValueType, which will always have a default constructor.")]
object? CreateValueType(Type t) => Activator.CreateInstance(t);
static object? CreateValueType(Type t) => Activator.CreateInstance(t);

// Handle nullable enums
if (defaultValue != null &&
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Common/src/Interop/Interop.Calendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static partial class Globalization
internal static extern unsafe ResultCode GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType calendarDataType, char* result, int resultCapacity);

[DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EnumCalendarInfo")]
internal static extern unsafe bool EnumCalendarInfo(delegate* <char*, IntPtr, void> callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context);
internal static extern unsafe bool EnumCalendarInfo(delegate* unmanaged<char*, IntPtr, void> callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context);

[DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")]
internal static extern int GetLatestJapaneseEra();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ internal static extern bool IsNLSDefinedString(
internal static extern int GetLocaleInfoEx(string lpLocaleName, uint LCType, void* lpLCData, int cchData);

[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
internal static extern bool EnumSystemLocalesEx(delegate* <char*, uint, void*, BOOL> lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved);
internal static extern bool EnumSystemLocalesEx(delegate* unmanaged<char*, uint, void*, BOOL> lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved);

[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
internal static extern bool EnumTimeFormatsEx(delegate* <char*, void*, BOOL> lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam);
internal static extern bool EnumTimeFormatsEx(delegate* unmanaged<char*, void*, BOOL> lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam);

[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
internal static extern int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue);
Expand All @@ -140,7 +140,7 @@ internal static extern bool IsNLSDefinedString(
internal static extern int GetGeoInfo(int location, int geoType, char* lpGeoData, int cchData, int LangId);

[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
internal static extern bool EnumCalendarInfoExEx(delegate* <char*, uint, IntPtr, void*, BOOL> pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string? lpReserved, uint CalType, void* lParam);
internal static extern bool EnumCalendarInfoExEx(delegate* unmanaged<char*, uint, IntPtr, void*, BOOL> pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string? lpReserved, uint CalType, void* lParam);

[StructLayout(LayoutKind.Sequential)]
internal struct NlsVersionInfoEx
Expand Down
9 changes: 6 additions & 3 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@

<Target Name="UpdateProjectReferencesWithAttributes" Condition="'@(ProjectReference)' != ''">
<ItemGroup>
<ProjectReference>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
</ProjectReference>
<ProjectReference Condition="'%(Filename)' == 'System.Private.CoreLib'">
<!-- Don't flow TargetFramework and Platform to use same inputs and outputs as the CoreLib's build as part of the runtime. -->
<UndefineProperties>$(UndefineProperties);TargetFramework;Platform</UndefineProperties>
Expand Down Expand Up @@ -291,4 +288,10 @@
</When>
</Choose>

<ItemGroup>
<!-- Workaround arcade default validate framework list which includes 6.0
as it was added to arcade before it branched off to a 5.0 only branch -->
<DefaultValidateFramework Remove="net6.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/libraries/System.Console/src/System/Console.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ public static Encoding OutputEncoding
if (s_out != null && !s_isOutTextWriterRedirected)
{
s_out.Flush();
Volatile.Write(ref s_out, null);
Volatile.Write(ref s_out, null!);
}
if (s_error != null && !s_isErrorTextWriterRedirected)
{
s_error.Flush();
Volatile.Write(ref s_error, null);
Volatile.Write(ref s_error, null!);
}

Volatile.Write(ref s_outputEncoding, (Encoding)value.Clone());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ internal static string GetUntruncatedProcessName(ref Interop.procfs.ParsedStat s
}
}

string? GetUntruncatedNameFromArg(Span<byte> arg, string prefix)
static string? GetUntruncatedNameFromArg(Span<byte> arg, string prefix)
{
// Strip directory names from arg.
int nameStart = arg.LastIndexOf((byte)'/') + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private static DateTimeOffset ParseGeneralizedTime(
const byte SuffixState = 2;
byte state = HmsState;

byte? GetNextState(byte octet)
static byte? GetNextState(byte octet)
{
if (octet == 'Z' || octet == '-' || octet == '+')
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ private unsafe void ProcessEvents(int numEvents,

this._context = ExecutionContext.Capture();

ParsedEvent ParseEvent(byte* nativeEventPath)
static ParsedEvent ParseEvent(byte* nativeEventPath)
{
int byteCount = 0;
Debug.Assert(nativeEventPath != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static ValueTask<int> ReadAsync(this Stream stream, Memory<byte> buffer,
byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
return FinishReadAsync(stream.ReadAsync(sharedBuffer, 0, buffer.Length, cancellationToken), sharedBuffer, buffer);

async ValueTask<int> FinishReadAsync(Task<int> readTask, byte[] localBuffer, Memory<byte> localDestination)
static async ValueTask<int> FinishReadAsync(Task<int> readTask, byte[] localBuffer, Memory<byte> localDestination)
{
try
{
Expand Down
Loading