From 0674e0ac587fd98bfc340be8e2695b5c3271a89c Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Sat, 21 Jan 2023 21:20:44 -0800 Subject: [PATCH] Use latest 2.1.x .NET SDK - noticed CI builds were using old 2.1.500 - `UseDotNet@2` seems to ignore `rollForward` when using global.json :frown: - nits: - quiet `dotnet` in CI (where `dotnet` is always new) - complain about all potentially missing components when VS isn't found - add a missing blank line --- azure-pipelines.yml | 2 ++ build.cmd | 4 ++++ global.json | 2 +- src/System.Net.Http.Formatting/Handlers/ProgressStream.cs | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f63cbb9fb..820089f1c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,6 +14,8 @@ parameters: variables: - name: DOTNET_CLI_TELEMETRY_OPTOUT value: 1 +- name: DOTNET_NOLOGO + value: 1 # Run CodeQL3000 tasks in a separate internal pipeline; not needed here. - name: Codeql.SkipTaskAutoInjection value: true diff --git a/build.cmd b/build.cmd index 1cc1cd4ea..798507f17 100644 --- a/build.cmd +++ b/build.cmd @@ -35,6 +35,10 @@ for /f "usebackq tokens=*" %%i in (`%vswhere% -version 16 -latest -prerelease -p set InstallDir="%%i" ) +if not DEFINED InstallDir ( + echo "Could not find a VS2019 installation with the necessary components (MSBuild, .NET Core 2.1 Runtime, .NET SDK). Please install VS2019 or the missing components." +) + if exist %InstallDir%\MSBuild\Current\Bin\MSBuild.exe ( set MSBuild=%InstallDir%\MSBuild\Current\Bin\MSBuild.exe ) else ( diff --git a/global.json b/global.json index 7b2cb540d..053fd617a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "2.1.500", + "version": "2.1.818", "rollForward": "major" } } diff --git a/src/System.Net.Http.Formatting/Handlers/ProgressStream.cs b/src/System.Net.Http.Formatting/Handlers/ProgressStream.cs index 8c169c94e..4ee57acf3 100644 --- a/src/System.Net.Http.Formatting/Handlers/ProgressStream.cs +++ b/src/System.Net.Http.Formatting/Handlers/ProgressStream.cs @@ -67,6 +67,7 @@ public override async Task ReadAsync(byte[] buffer, int offset, int count, ReportBytesReceived(readCount, userState: null); return readCount; } + #if !NETFX_CORE // BeginX and EndX are not supported on streams in portable libraries public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) {