Summary
Update the target frameworks for the Microsoft.Graph.Core library and test projects to align with currently supported .NET runtimes.
Proposed Target Frameworks
Core library (Microsoft.Graph.Core.csproj):
netstandard2.0
netstandard2.1
net462
net8.0
net10.0
Test project (Microsoft.Graph.DotnetCore.Core.Test.csproj):
Trimming test project (Microsoft.Graph.DotnetCore.Core.Trimming.csproj):
Changes Required
- Update
TargetFrameworks in src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj
- Update
Directory.Build.props to remove the default net6.0 MAUI target and update MAUI platform targets from net6.0-* to net8.0-*
- Update test project TFMs from
net6.0 to net462;net8.0;net10.0
- Update trimming test project TFM from
net9.0 to net10.0
- Downgrade
xunit.runner.visualstudio from 3.0.2 to 2.5.8 for net462 compatibility
- Add conditional compilation directives in test code for
net462 compatibility:
- Replace C# range/index syntax with compatible alternatives
- Use
new HttpMethod("PATCH") instead of HttpMethod.Patch
- Use
#if NETFRAMEWORK guards for WinHttpHandler vs SocketsHttpHandler assertions
- Use
#if NETFRAMEWORK guards for using vs await using on streams
- Fix
HandlesCancellationTokenAsync test to use Assert.ThrowsAnyAsync<OperationCanceledException> to handle runtime differences across TFMs
Motivation
net6.0 and net9.0 are end-of-life
netstandard2.1 adds support for additional APIs (e.g., Span<T>, IAsyncDisposable)
net8.0 is the current LTS release
net10.0 is the latest supported runtime
Summary
Update the target frameworks for the Microsoft.Graph.Core library and test projects to align with currently supported .NET runtimes.
Proposed Target Frameworks
Core library (
Microsoft.Graph.Core.csproj):netstandard2.0netstandard2.1net462net8.0net10.0Test project (
Microsoft.Graph.DotnetCore.Core.Test.csproj):net462net8.0net10.0Trimming test project (
Microsoft.Graph.DotnetCore.Core.Trimming.csproj):net10.0Changes Required
TargetFrameworksinsrc/Microsoft.Graph.Core/Microsoft.Graph.Core.csprojDirectory.Build.propsto remove the defaultnet6.0MAUI target and update MAUI platform targets fromnet6.0-*tonet8.0-*net6.0tonet462;net8.0;net10.0net9.0tonet10.0xunit.runner.visualstudiofrom3.0.2to2.5.8fornet462compatibilitynet462compatibility:new HttpMethod("PATCH")instead ofHttpMethod.Patch#if NETFRAMEWORKguards forWinHttpHandlervsSocketsHttpHandlerassertions#if NETFRAMEWORKguards forusingvsawait usingon streamsHandlesCancellationTokenAsynctest to useAssert.ThrowsAnyAsync<OperationCanceledException>to handle runtime differences across TFMsMotivation
net6.0andnet9.0are end-of-lifenetstandard2.1adds support for additional APIs (e.g.,Span<T>,IAsyncDisposable)net8.0is the current LTS releasenet10.0is the latest supported runtime