Skip to content

Upgrade test/sample projects to .NET 8.0 and bump dependencies#1323

Merged
berndverst merged 12 commits intoAzure:mainfrom
berndverst:upgrade/net8-and-dependencies
Mar 20, 2026
Merged

Upgrade test/sample projects to .NET 8.0 and bump dependencies#1323
berndverst merged 12 commits intoAzure:mainfrom
berndverst:upgrade/net8-and-dependencies

Conversation

@berndverst
Copy link
Member

Summary

Upgrades all test and sample projects from net6.0 to net8.0 and applies all pending Dependabot package updates, resolving transitive dependency downgrades and compilation issues along the way.

Note: Source/library projects (DurableTask.Core, DurableTask.AzureStorage, etc.) remain on netstandard2.0 — only test and sample projects are retarget.


Changes

🎯 Framework Upgrade: net6.0net8.0

Test projects (multi-target net8.0;net48 preserved):

  • DurableTask.Core.Tests
  • DurableTask.AzureStorage.Tests
  • DurableTask.ServiceBus.Tests
  • DurableTask.Emulator.Tests
  • DurableTask.Stress.Tests

Sample projects (single-target net8.0):

  • Correlation.Samples
  • OpenTelemetrySample
  • ApplicationInsightsSample
  • ManagedIdentity.AzStorageV1

Directory.Packages.props — Updated framework-conditional ItemGroup conditions from net6.0 to net8.0 (CommandLineParser, WindowsAzure.Storage, SemanticLogging.NetCore sections).

DurableTask.ServiceBus.Tests.csproj — Updated net6.0-specific ItemGroup conditions to net8.0.


📦 Dependabot Package Updates

Applies the following pending Dependabot PRs in a single consolidated change:

Package Old Version New Version Dependabot PR
Azure.Storage.Blobs 12.24.0 12.27.0 #1310
Azure.Monitor.OpenTelemetry.Exporter 1.0.0-beta.4 1.6.0 #1309
Azure.Identity 1.12.0 1.18.0 #1308
Microsoft.ApplicationInsights 2.21.0 2.23.0 #1291
System.Text.RegularExpressions (none) 4.3.1 #1275 (security pin)

🔧 Transitive Dependency Bumps (NU1605 resolution)

The Dependabot updates pulled in newer transitive dependencies, causing NU1605 package downgrade errors. The following were bumped to match:

Package Old Version New Version Reason
Microsoft.Bcl.AsyncInterfaces 6.0.0 8.0.0 Required by Azure.Core 1.50.0
System.Text.Json 6.0.10 10.0.3 Required by Microsoft.Extensions.Logging.Console 10.0.3; also fixes known CVEs in 8.0.0
Microsoft.Extensions.Logging* 8.0.0 10.0.3 Required by Azure.Identity 1.18.0 → Microsoft.Extensions.Hosting.Abstractions 10.0.3 (net8.0 condition only)

🛠️ Compilation Fixes

Azure.Storage.Blobs 12.27.0 — Removed default parameter values

BlobContainerClient.GetBlobsAsync() and GetBlobsByHierarchyAsync() no longer have default parameter values in 12.27.0 (method signatures are identical, only the defaults were removed). Affected call sites now pass the previous implicit defaults explicitly:

  • AzureStorageScaleTests.csGetBlobsAsync(traits: BlobTraits.None, states: BlobStates.None, prefix: ..., cancellationToken: default)
  • AzureStorageScenarioTests.cs (×2) — Same pattern for GetBlobsAsync and GetBlobsByHierarchyAsync

.NET 8 obsolete serialization APIs (SYSLIB0050/0051)

Formatter-based serialization APIs (FormatterServices, ISerializable.GetObjectData) are obsolete in .NET 8. Added targeted #pragma warning disable/restore in test files:

  • CustomExceptionsTests.csSYSLIB0050 for FormatterConverter, SYSLIB0051 for GetObjectData
  • ExceptionHandlingIntegrationTests.csSYSLIB0051, CS0672 for serialization constructors and GetObjectData overrides
  • LegacyTableEntityConverter.csSYSLIB0050 for FormatterServices.GetUninitializedObject

ILogger.BeginScope nullability change (CS8633/CS8766)

Microsoft.Extensions.Logging 10.0.3 changed the nullability constraint on ILogger.BeginScope<TState>. Added pragma suppression in WorkItemDispatcherTests.cs since the mock logger must compile against both net48 (v6.0.0) and net8.0 (v10.0.3) targets.


Build Verification

dotnet build DurableTask.sln0 errors, 0 warnings

Related Dependabot PRs

This PR supersedes the following Dependabot PRs:

- Retarget all test projects from net6.0 to net8.0 (net48 multi-target preserved)
- Retarget all sample projects from net6.0 to net8.0
- Update framework-conditional ItemGroups in Directory.Packages.props
- Apply pending dependabot package updates:
  - Azure.Storage.Blobs 12.24.0 -> 12.27.0
  - Azure.Monitor.OpenTelemetry.Exporter 1.0.0-beta.4 -> 1.6.0
  - Azure.Identity 1.12.0 -> 1.18.0
  - Microsoft.ApplicationInsights 2.21.0 -> 2.23.0
  - System.Text.RegularExpressions 4.3.1 (security pin)
- Bump transitive dependencies to resolve NU1605 downgrades:
  - Microsoft.Bcl.AsyncInterfaces 6.0.0 -> 8.0.0
  - System.Text.Json 6.0.10 -> 10.0.3
  - Microsoft.Extensions.Logging* 8.0.0 -> 10.0.3 (net8.0)
- Fix compilation issues from API changes:
  - Add explicit parameters for Blob API calls (12.27.0 removed defaults)
  - Suppress SYSLIB0050/0051 for obsolete formatter serialization in tests
  - Suppress CS8633/CS8766 for ILogger.BeginScope nullability changes
Copilot AI review requested due to automatic review settings March 20, 2026 00:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the repository’s test and sample projects to target .NET 8 while consolidating Dependabot-driven dependency bumps and adjusting call sites / pragmas to keep builds clean under updated APIs.

Changes:

  • Retargeted test projects from net6.0 to net8.0 (while preserving net48 where applicable) and upgraded sample projects to net8.0.
  • Updated central package versions (and framework-conditional package selections) in Directory.Packages.props.
  • Applied compilation fixes for updated Azure SDK method signatures and .NET 8 obsoletions via explicit parameters and targeted warning suppressions.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/DurableTask.Stress.Tests/DurableTask.Stress.Tests.csproj Retarget stress tests to net8.0;net48.
test/DurableTask.ServiceBus.Tests/DurableTask.ServiceBus.Tests.csproj Retarget to net8.0;net48 and update ItemGroup conditions from net6.0net8.0.
test/DurableTask.Emulator.Tests/DurableTask.Emulator.Tests.csproj Retarget emulator tests to net8.0;net48.
test/DurableTask.Core.Tests/WorkItemDispatcherTests.cs Suppress logging nullability warnings for multi-target compatibility.
test/DurableTask.Core.Tests/ExceptionHandlingIntegrationTests.cs Suppress obsolete serialization warnings for .NET 8.
test/DurableTask.Core.Tests/DurableTask.Core.Tests.csproj Retarget core tests to net8.0;net48.
test/DurableTask.Core.Tests/CustomExceptionsTests.cs Suppress obsolete formatter-based serialization warnings for test-only serialization logic.
test/DurableTask.AzureStorage.Tests/Obsolete/LegacyTableEntityConverter.cs Suppress obsolete FormatterServices usage warning in legacy converter used by tests.
test/DurableTask.AzureStorage.Tests/DurableTask.AzureStorage.Tests.csproj Retarget storage tests to net8.0;net48 and add a security pin package reference.
test/DurableTask.AzureStorage.Tests/AzureStorageScenarioTests.cs Adjust blob listing calls to pass explicit defaults after SDK signature changes.
test/DurableTask.AzureStorage.Tests/AzureStorageScaleTests.cs Adjust blob listing call to pass explicit defaults after SDK signature changes.
samples/ManagedIdentitySample/DTFx.AzureStorage v1.x/ManagedIdentity.AzStorageV1.csproj Retarget sample to net8.0.
samples/DistributedTraceSample/OpenTelemetry/OpenTelemetrySample.csproj Retarget sample to net8.0.
samples/DistributedTraceSample/ApplicationInsights/ApplicationInsightsSample.csproj Retarget sample to net8.0.
samples/Correlation.Samples/Correlation.Samples.csproj Retarget sample to net8.0.
Directory.Packages.props Central package version bumps + framework-conditional dependency updates for the .NET 8 move.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Bernd Verst added 2 commits March 19, 2026 17:13
- Fix GetBlobsByHierarchyAsync delimiter from null to '/' to preserve hierarchy semantics
- Add explanatory comment for SYSLIB0050 suppression in LegacyTableEntityConverter
- Replace .NET 6 SDK install with .NET 8 in Azure DevOps build-steps.yml
- Add .NET 8 SDK setup step in CodeQL GitHub Actions workflow
Copilot AI review requested due to automatic review settings March 20, 2026 00:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

test/DurableTask.Core.Tests/ExceptionHandlingIntegrationTests.cs:1

  • These warning suppressions cover multiple members at once. To reduce the risk of accidentally hiding new warnings added later, scope the #pragma warning disable/restore as tightly as possible (e.g., wrap only the serialization ctor and the specific GetObjectData override line/block that triggers the warning, or use member-level suppression attributes).
//  ----------------------------------------------------------------------------------

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Bernd Verst added 2 commits March 19, 2026 18:56
…coping

- Use #if NET8_0_OR_GREATER for BeginScope<TState> to match ILogger contract per TFM
- Split pragma suppressions for serialization ctor and GetObjectData into separate blocks
Azure Storage tests exceed the default 60-minute job timeout due to
the larger test suite and Azurite emulator startup overhead.
Copilot AI review requested due to automatic review settings March 20, 2026 03:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Bernd Verst added 2 commits March 19, 2026 22:17
- Increase DTFxASValidate job timeout from 90 to 150 minutes
- Update VSTest version from 17.0 to latest for better .NET 8 test runtime support
The previous fix changed delimiter from null (the SDK default) to '/' per
a review suggestion. However, with delimiter='/' and prefix without a
trailing slash, blobs are returned as virtual directory prefixes (IsBlob=false)
rather than blob items, causing the Where(x => x.IsBlob) filter to return
no results.
Copilot AI review requested due to automatic review settings March 20, 2026 06:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Bernd Verst added 2 commits March 19, 2026 23:35
…ation

Move service.CreateAsync() from TestOrchestrationHost constructor (where it
blocked synchronously via .GetAwaiter().GetResult()) to StartAsync() (where
it is properly awaited). This eliminates the primary source of threadpool
starvation when many tests run in parallel under .NET 8.

Also convert remaining .Result and .GetAwaiter().GetResult() calls to proper
await patterns in AzureStorageScaleTests and TestTablePartitionManager.
…ion, add pragma comments

- Condition System.Text.RegularExpressions PackageReference on net48 only
- Revert vsTestVersion from 'latest' back to '17.0' for CI reproducibility
- Add justification comments on SYSLIB0051 pragma suppressions in
  ExceptionHandlingIntegrationTests.cs
Copilot AI review requested due to automatic review settings March 20, 2026 06:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Bernd Verst added 2 commits March 20, 2026 01:35
Reduce TestHelpers LoggerFactory console log level from Trace to Warning to
reduce contention from verbose output under Microsoft.Extensions.Logging 10.x.
Remove the 150-minute timeout override (revert to default) since the
sync-over-async fix should prevent threadpool starvation hangs.
Azure.Storage.Blobs 12.27.0 uses API version 2026-02-06 which is not
supported by the Azurite version installed in CI via 'npm install -g azurite'.
This causes tests to hang as the SDK's retry logic repeatedly fails.

Add --skipApiVersionCheck to the Azurite startup command to allow the
newer API version to work with the installed Azurite version.
Copilot AI review requested due to automatic review settings March 20, 2026 09:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The BaseProcessor<T> in OpenTelemetry SDK 1.14.0 (transitive from
Azure.Monitor.OpenTelemetry.Exporter 1.6.0) changed method signatures -
OnShutdown and OnForceFlush now take int timeoutMilliseconds parameters.
This broke the hard-coded processor.Invocations[index] pattern which assumed
fixed invocation ordering.

Replace fragile index-based access with filtering for OnEnd method
invocations, which gives us only the completed Activity objects regardless
of SDK-internal invocation changes.
@berndverst berndverst merged commit bdd7164 into Azure:main Mar 20, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants