Skip to content

Conversation

@BorisDog
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 24, 2025 23:21
@BorisDog BorisDog requested a review from a team as a code owner November 24, 2025 23:21
@BorisDog BorisDog requested a review from adelinowona November 24, 2025 23:21
@BorisDog BorisDog requested review from sanych-sun and removed request for adelinowona November 24, 2025 23:22
Copilot finished reviewing on behalf of BorisDog November 24, 2025 23: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

This PR adds .NET 10.0 support to unit tests and smoke tests in the MongoDB C# driver, aligning with the release of .NET 10. The changes include updating target frameworks, migrating from deprecated X509Certificate2 constructors to the modern X509CertificateLoader API, suppressing obsolescence warnings, and extending CI/CD configurations.

  • Adds .NET 10.0 as a target framework for test projects alongside existing targets (netcoreapp3.1, net472, net5.0, net6.0, net8.0)
  • Migrates X509Certificate2 loading to use X509CertificateLoader methods to avoid deprecated constructors
  • Adds appropriate pragma warning suppressions for obsolete APIs (CA2022, SYSLIB0050)

Reviewed changes

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

Show a summary per file
File Description
tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/MongoDB.Driver.SmokeTests.Sdk.csproj Adds net10.0 target framework and Microsoft.Extensions.* 10.0.0 package references; removes OSX-specific condition for net8.0
tests/BuildProps/Tests.Build.props Adds net10.0 to default target frameworks for test projects
tests/MongoDB.Driver.Examples/MongoDB.Driver.Examples.csproj Includes net10.0 in conditional package reference for AWS Lambda dependencies
tests/MongoDB.Driver.TestHelpers/X509CertificateLoader.cs Introduces helper class providing backward compatibility for X509Certificate2 loading across .NET versions
tests/MongoDB.Driver.Tests/X509Tests.cs Migrates from deprecated X509Certificate2 constructor to X509CertificateLoader.LoadPkcs12FromFile
tests/MongoDB.Driver.Tests/SslSettingsTests.cs Updates certificate loading to use X509CertificateLoader; adopts collection expressions
tests/MongoDB.Driver.Tests/AuthenticationTests.cs Migrates X509Certificate2 instantiation to use X509CertificateLoader helper
tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/EncryptionTestHelper.cs Simplifies certificate loading logic using X509CertificateLoader and collection expressions
tests/MongoDB.Driver.Tests/Core/Configuration/SslStreamSettingsTests.cs Replaces empty byte array certificates with embedded test certificate data; migrates to X509CertificateLoader
tests/MongoDB.Driver.TestHelpers/Core/CoreTestConfiguration.cs Updates certificate loading to use X509CertificateLoader methods
tests/MongoDB.Driver.Tests/GridFS/GridFSSeekableDownloadStreamTests.cs Adds CA2022 warning suppression for intentional use of deprecated Stream.Read overload in tests
tests/MongoDB.Bson.Tests/IO/ByteBufferStreamTests.cs Adds CA2022 warning suppression for test code validating deprecated Stream.Read behavior
tests/MongoDB.Bson.Tests/IO/BsonStreamAdapterTests.cs Adds CA2022 warning suppression for testing deprecated Stream.Read method
tests/MongoDB.Bson.Tests/Serialization/BsonMemberMapTests.cs Adds SYSLIB0050 warning suppression for intentional use of FormatterServices.GetUninitializedObject in test utilities
tests/MongoDB.Bson.Tests/Serialization/BsonClassMapTests.cs Adds SYSLIB0050 warning suppression for test code using FormatterServices.GetUninitializedObject
evergreen/evergreen.yml Adds unit-tests-net100 and test-smoke-tests-net100 tasks for all supported platforms
evergreen/install-dotnet.sh Updates default SDK version to 10.0 and adds net10.0 runtime version mapping

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

@BorisDog BorisDog added the chore Non–user-facing code changes (tests, build scripts, etc.). label Nov 25, 2025
var count = 2;
subject.Dispose();

#pragma warning disable CA2022
Copy link
Member

Choose a reason for hiding this comment

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

Can we create a Jira ticket to review all suppressed warnings and see if we can resolve them? Or if we are OK with this, should we suppress the warning in project file instead for tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, will look into this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored, no need to disable the warning. Thanks for bringing this up.


private BsonClassMap Clone(BsonClassMap classMap)
{
#pragma warning disable SYSLIB0050
Copy link
Member

Choose a reason for hiding this comment

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

Should we have a ticket to look into the warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thanks: CSHARP-5794

sanych-sun
sanych-sun previously approved these changes Nov 25, 2025
Copy link
Member

@sanych-sun sanych-sun left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@sanych-sun sanych-sun left a comment

Choose a reason for hiding this comment

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

LGTM

@BorisDog BorisDog merged commit d06d817 into mongodb:main Nov 26, 2025
139 of 153 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Non–user-facing code changes (tests, build scripts, etc.).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants