From 146225ae48ed6fecda2f870b7e06be28dc7f8ba6 Mon Sep 17 00:00:00 2001 From: "Gavin Barron (from Dev Box)" Date: Wed, 29 Apr 2026 18:47:21 -0700 Subject: [PATCH 1/3] feat!: update target frameworks to net8.0 and net10.0, drop net5.0 BREAKING CHANGE: Dropped net5.0 target framework. The SDK now targets netstandard2.0, netstandard2.1, net8.0, and net10.0. - Update TFMs in Microsoft.Graph.Beta.csproj - Update test project to target net8.0 and net10.0 - Add .NET 10 SDK to CI/CD pipelines - Simplify per-TFM build steps in pipelines Closes #1110 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/validatePullRequest.yml | 16 +++++++------- pipelines/ci-build.yml | 21 +++++++------------ .../Microsoft.Graph.Beta.csproj | 2 +- .../Microsoft.Graph.DotnetCore.Test.csproj | 2 +- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/validatePullRequest.yml b/.github/workflows/validatePullRequest.yml index 73e2d287a3b3..6656ee035282 100644 --- a/.github/workflows/validatePullRequest.yml +++ b/.github/workflows/validatePullRequest.yml @@ -23,15 +23,11 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5.2.0 with: - dotnet-version: 8.x + dotnet-version: | + 8.x + 10.x - name: Restore dependencies run: dotnet restore ${{ env.solutionName }} - - name: Build for netstandard2.0 - run: dotnet build ${{ env.projectName }} -f netstandard2.0 --no-restore -c Release - - name: Build for netstandard2.1 - run: dotnet build ${{ env.projectName }} -f netstandard2.1 --no-restore -c Release - - name: Build for net5.0 - run: dotnet build ${{ env.projectName }} -f net5.0 --no-restore -c Release - name: Build run: dotnet build ${{ env.solutionName }} --no-restore -c Release - name: Test @@ -54,6 +50,12 @@ jobs: uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} + - name: Setup .NET + uses: actions/setup-dotnet@v5.2.0 + with: + dotnet-version: | + 8.x + 10.x - name: Restore dependencies run: dotnet restore ${{ env.solutionName }} - name: Build for netstandard2.0 diff --git a/pipelines/ci-build.yml b/pipelines/ci-build.yml index 3d713b09b88a..5ff94d31652d 100644 --- a/pipelines/ci-build.yml +++ b/pipelines/ci-build.yml @@ -51,6 +51,11 @@ extends: inputs: packageType: sdk version: 8.x + - task: UseDotNet@2 + displayName: 'Use .NET 10.x sdk' + inputs: + packageType: sdk + version: 10.x - task: UseDotNet@2 displayName: 'Use .NET 6.x (for code signing tasks)' inputs: @@ -90,22 +95,10 @@ extends: workingDirectory: src displayName: 'Set project ready to sign' - task: DotNetCoreCLI@2 - displayName: 'dotnet build netstandard2.0' - inputs: - projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.Beta.csproj' - arguments: '-c $(BuildConfiguration) --no-incremental -f netstandard2.0 --no-restore' - - - task: DotNetCoreCLI@2 - displayName: 'dotnet build netstandard2.1' + displayName: 'dotnet build' inputs: projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.Beta.csproj' - arguments: '-c $(BuildConfiguration) --no-incremental -f netstandard2.1 --no-restore' - - - task: DotNetCoreCLI@2 - displayName: 'dotnet build net5.0' - inputs: - projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.Beta.csproj' - arguments: '-c $(BuildConfiguration) --no-incremental -f net5.0 --no-restore' + arguments: '-c $(BuildConfiguration) --no-incremental --no-restore' - task: DotNetCoreCLI@2 displayName: 'dotnet build test project' inputs: diff --git a/src/Microsoft.Graph/Microsoft.Graph.Beta.csproj b/src/Microsoft.Graph/Microsoft.Graph.Beta.csproj index 95c408937572..e37e24c0b77e 100644 --- a/src/Microsoft.Graph/Microsoft.Graph.Beta.csproj +++ b/src/Microsoft.Graph/Microsoft.Graph.Beta.csproj @@ -5,7 +5,7 @@ © Microsoft Corporation. All rights reserved. Microsoft Graph Beta Client Library Microsoft - netstandard2.0;netstandard2.1;net5.0 + netstandard2.0;netstandard2.1;net8.0;net10.0 latest false Microsoft.Graph.Beta diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj b/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj index d4f41f5c4fcf..7e7599e07958 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj +++ b/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj @@ -1,7 +1,7 @@ - net8.0 + net8.0;net10.0 false Microsoft.Graph.DotnetCore.Test true From 30c8521148fb94248e8461b3358954e1e9b2aa29 Mon Sep 17 00:00:00 2001 From: "Gavin Barron (from Dev Box)" Date: Wed, 29 Apr 2026 19:00:42 -0700 Subject: [PATCH 2/3] fix: use per-TFM builds in PR workflow to avoid OOM on runner Building all TFMs in parallel via solution build causes exit code 137 (OOM kill) on GitHub Actions ubuntu-latest runners. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/validatePullRequest.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validatePullRequest.yml b/.github/workflows/validatePullRequest.yml index 6656ee035282..4ec0b38c9b7f 100644 --- a/.github/workflows/validatePullRequest.yml +++ b/.github/workflows/validatePullRequest.yml @@ -28,7 +28,15 @@ jobs: 10.x - name: Restore dependencies run: dotnet restore ${{ env.solutionName }} - - name: Build + - name: Build for netstandard2.0 + run: dotnet build ${{ env.projectName }} -f netstandard2.0 --no-restore -c Release + - name: Build for netstandard2.1 + run: dotnet build ${{ env.projectName }} -f netstandard2.1 --no-restore -c Release + - name: Build for net8.0 + run: dotnet build ${{ env.projectName }} -f net8.0 --no-restore -c Release + - name: Build for net10.0 + run: dotnet build ${{ env.projectName }} -f net10.0 --no-restore -c Release + - name: Build test project run: dotnet build ${{ env.solutionName }} --no-restore -c Release - name: Test run: dotnet test ${{ env.solutionName }} --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=opencover From a8e6f94d72de7ea63f1a2e243c737c1b7889f566 Mon Sep 17 00:00:00 2001 From: "Gavin Barron (from Dev Box)" Date: Wed, 29 Apr 2026 19:15:02 -0700 Subject: [PATCH 3/3] fix: sequential TFM builds in ADO pipeline and suppress NU1510 warning - Update ADO ci-build.yml to build each TFM sequentially (same OOM fix as GitHub Actions workflow) - Add comments explaining why per-TFM builds are necessary - Suppress NU1510 package pruning warning for System.Net.Http on netstandard2.0 (false positive from .NET 10 SDK) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/validatePullRequest.yml | 2 ++ pipelines/ci-build.yml | 21 +++++++++++++++++-- .../Microsoft.Graph.Beta.csproj | 3 ++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validatePullRequest.yml b/.github/workflows/validatePullRequest.yml index 4ec0b38c9b7f..5507d0e7a15e 100644 --- a/.github/workflows/validatePullRequest.yml +++ b/.github/workflows/validatePullRequest.yml @@ -28,6 +28,8 @@ jobs: 10.x - name: Restore dependencies run: dotnet restore ${{ env.solutionName }} + # Build each TFM sequentially to avoid OOM kills on the runner. + # Building all TFMs in parallel exhausts memory on standard GitHub Actions runners (exit code 137). - name: Build for netstandard2.0 run: dotnet build ${{ env.projectName }} -f netstandard2.0 --no-restore -c Release - name: Build for netstandard2.1 diff --git a/pipelines/ci-build.yml b/pipelines/ci-build.yml index 5ff94d31652d..c95744f5b325 100644 --- a/pipelines/ci-build.yml +++ b/pipelines/ci-build.yml @@ -94,11 +94,28 @@ extends: Write-Host "Updated the .csproj files so that we can sign the built assemblies." workingDirectory: src displayName: 'Set project ready to sign' + # Build each TFM sequentially to avoid OOM kills on the build agent. + # Building all TFMs in parallel exhausts memory on standard runners (exit code 137). - task: DotNetCoreCLI@2 - displayName: 'dotnet build' + displayName: 'dotnet build netstandard2.0' inputs: projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.Beta.csproj' - arguments: '-c $(BuildConfiguration) --no-incremental --no-restore' + arguments: '-c $(BuildConfiguration) --no-incremental -f netstandard2.0 --no-restore' + - task: DotNetCoreCLI@2 + displayName: 'dotnet build netstandard2.1' + inputs: + projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.Beta.csproj' + arguments: '-c $(BuildConfiguration) --no-incremental -f netstandard2.1 --no-restore' + - task: DotNetCoreCLI@2 + displayName: 'dotnet build net8.0' + inputs: + projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.Beta.csproj' + arguments: '-c $(BuildConfiguration) --no-incremental -f net8.0 --no-restore' + - task: DotNetCoreCLI@2 + displayName: 'dotnet build net10.0' + inputs: + projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.Beta.csproj' + arguments: '-c $(BuildConfiguration) --no-incremental -f net10.0 --no-restore' - task: DotNetCoreCLI@2 displayName: 'dotnet build test project' inputs: diff --git a/src/Microsoft.Graph/Microsoft.Graph.Beta.csproj b/src/Microsoft.Graph/Microsoft.Graph.Beta.csproj index e37e24c0b77e..83b3ef5424f2 100644 --- a/src/Microsoft.Graph/Microsoft.Graph.Beta.csproj +++ b/src/Microsoft.Graph/Microsoft.Graph.Beta.csproj @@ -86,7 +86,8 @@ - + +