Added .NET 6.0 support#27
Conversation
…ces for compatibility
Introduced a JsonSerializerOptions instance with DefaultJsonTypeInfoResolver and WriteIndented for improved schema output formatting in collection tests.
…nd improve clarity
Test Results 3 files 3 suites 3m 23s ⏱️ Results for commit 961afea. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull Request Overview
This pull request adds .NET 6.0 support to ReflectorNet and its test projects, expanding compatibility from the previous .NET 8.0+ and netstandard2.1 baseline. The changes introduce framework-specific package references and conditional compilation directives to handle differences in nullability detection across framework versions.
- Added
net6.0to target frameworks across all projects - Implemented conditional package references for framework-specific dependencies
- Consolidated repetitive test methods into parameterized theories to reduce code duplication
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ReflectorNet/ReflectorNet.csproj | Added net6.0 target framework with conditional package references for Microsoft.Extensions.Logging and System.Text.Json |
| ReflectorNet.Tests/ReflectorNet.Tests.csproj | Added net6.0 target framework with framework-specific test SDK and dependency versions |
| ReflectorNet.Tests.OuterAssembly/ReflectorNet.Tests.OuterAssembly.csproj | Added net6.0 target framework with conditional System.Text.Json package reference |
| ReflectorNet.Tests/Utils/MethodUtilsTests.cs | Added conditional compilation directives to exclude nullable generic type tests on frameworks below .NET 8.0 |
| ReflectorNet.Tests/SchemaTests/ReturnSchemaTests.cs | Refactored repetitive test methods into parameterized theories using InlineData attributes, added helper methods, and introduced method name constants |
| ReflectorNet.Tests/SchemaTests/CollectionsTests.cs | Added TypeInfoResolver to JsonSerializerOptions for .NET 6.0 compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…versions for build-and-test jobs
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
ReflectorNet.Tests/ReflectorNet.Tests.csproj:25
- The version '3.1.5' of xunit.runner.visualstudio does not exist. As of January 2025, the latest stable version is in the 2.x range (e.g., 2.8.2). This should be changed to a valid version such as '2.8.2' (same as the .NET 6.0 configuration).
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request adds support for the
net6.0target framework to the main library and test projects, ensuring compatibility with older .NET versions. It also introduces conditional package references fornet6.0to use appropriate package versions, and updates some tests to handle framework-specific behaviors.Framework and Package Compatibility:
net6.0as a target framework toReflectorNet,ReflectorNet.Tests, andReflectorNet.Tests.OuterAssemblyprojects for broader .NET compatibility. [1] [2] [3]ItemGroups in.csprojfiles to referenceSystem.Text.Jsonand other packages with versions compatible withnet6.0, while newer frameworks use the latest versions. [1] [2] [3]Microsoft.NET.Test.Sdkandxunit.runner.visualstudiouse versions that supportnet6.0.Test Improvements and Framework-specific Handling:
JsonSerializerOptionswith aDefaultJsonTypeInfoResolver, improving serialization compatibility across frameworks.#if NET8_0_OR_GREATERto ensure correct nullability checks for generic type parameters only on supported frameworks. [1] [2]