From 6719f63bc29cd3ae0bf4110bd039ee116c6a6d43 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Tue, 25 Feb 2025 20:01:46 -0800 Subject: [PATCH 01/14] Target .NET 10. Signed-off-by: Bradley Grainger --- .ci/build-steps.yml | 26 +- .ci/conformance-test-steps.yml | 2 +- .ci/integration-tests-steps.yml | 4 +- .ci/mysqlconnector-tests-steps.yml | 6 +- .ci/test.ps1 | 2 +- .github/workflows/ci.yml | 2 +- appveyor.yml | 2 +- azure-pipelines.yml | 8 +- global.json | 2 +- .../packages.lock.json | 6 +- src/MySqlConnector/Logging/Log.cs | 8 +- src/MySqlConnector/MySqlConnector.csproj | 2 +- src/MySqlConnector/packages.lock.json | 116 +++++---- .../Conformance.Tests.csproj | 2 +- tests/Conformance.Tests/packages.lock.json | 12 +- .../IntegrationTests/IntegrationTests.csproj | 5 +- tests/IntegrationTests/packages.lock.json | 231 ++++++------------ ...Connector.DependencyInjection.Tests.csproj | 2 +- .../packages.lock.json | 2 +- .../MySqlConnector.NativeAot.Tests.csproj | 2 +- .../packages.lock.json | 28 +-- .../MySqlConnector.Tests.csproj | 2 +- tests/MySqlConnector.Tests/packages.lock.json | 12 +- .../SchemaCollectionGenerator.csproj | 2 +- .../packages.lock.json | 2 +- 25 files changed, 199 insertions(+), 289 deletions(-) diff --git a/.ci/build-steps.yml b/.ci/build-steps.yml index b3d6d0895..95e8d67a6 100644 --- a/.ci/build-steps.yml +++ b/.ci/build-steps.yml @@ -27,52 +27,52 @@ steps: displayName: 'Publish MySqlConnector.Tests' inputs: command: 'publish' - arguments: '-c Release -f net9.0 --no-build tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj' + arguments: '-c Release -f net10.0 --no-build tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj' publishWebProjects: false zipAfterPublish: false - task: PublishPipelineArtifact@1 inputs: - artifact: 'MySqlConnector.Tests-9.0-$(Agent.OS)' - targetPath: 'artifacts/publish/MySqlConnector.Tests/release_net9.0' + artifact: 'MySqlConnector.Tests-10.0-$(Agent.OS)' + targetPath: 'artifacts/publish/MySqlConnector.Tests/release_net10.0' publishLocation: 'pipeline' - task: DotNetCoreCLI@2 displayName: 'Publish Conformance.Tests' inputs: command: 'publish' - arguments: '-c Release -f net9.0 --no-build tests/Conformance.Tests/Conformance.Tests.csproj' + arguments: '-c Release -f net10.0 --no-build tests/Conformance.Tests/Conformance.Tests.csproj' publishWebProjects: false zipAfterPublish: false - task: PublishPipelineArtifact@1 inputs: - artifact: 'Conformance.Tests-9.0-$(Agent.OS)' - targetPath: 'artifacts/publish/Conformance.Tests/release_net9.0' + artifact: 'Conformance.Tests-10.0-$(Agent.OS)' + targetPath: 'artifacts/publish/Conformance.Tests/release_net10.0' publishLocation: 'pipeline' - task: DotNetCoreCLI@2 displayName: 'Publish MySqlConnector.DependencyInjection.Tests' inputs: command: 'publish' - arguments: '-c Release -f net9.0 --no-build tests/MySqlConnector.DependencyInjection.Tests/MySqlConnector.DependencyInjection.Tests.csproj' + arguments: '-c Release -f net10.0 --no-build tests/MySqlConnector.DependencyInjection.Tests/MySqlConnector.DependencyInjection.Tests.csproj' publishWebProjects: false zipAfterPublish: false - task: PublishPipelineArtifact@1 inputs: - artifact: 'MySqlConnector.DependencyInjection.Tests-9.0-$(Agent.OS)' - targetPath: 'artifacts/publish/MySqlConnector.DependencyInjection.Tests/release_net9.0' + artifact: 'MySqlConnector.DependencyInjection.Tests-10.0-$(Agent.OS)' + targetPath: 'artifacts/publish/MySqlConnector.DependencyInjection.Tests/release_net10.0' publishLocation: 'pipeline' - task: DotNetCoreCLI@2 - displayName: 'Publish IntegrationTests (9.0)' + displayName: 'Publish IntegrationTests (10.0)' inputs: command: 'publish' - arguments: '-c Release -f net9.0 --no-build tests/IntegrationTests/IntegrationTests.csproj' + arguments: '-c Release -f net10.0 --no-build tests/IntegrationTests/IntegrationTests.csproj' publishWebProjects: false zipAfterPublish: false - task: PublishPipelineArtifact@1 inputs: - artifact: 'IntegrationTests-net9.0-$(Agent.OS)' - targetPath: 'artifacts/publish/IntegrationTests/release_net9.0' + artifact: 'IntegrationTests-net10.0-$(Agent.OS)' + targetPath: 'artifacts/publish/IntegrationTests/release_net10.0' publishLocation: 'pipeline' - task: DotNetCoreCLI@2 diff --git a/.ci/conformance-test-steps.yml b/.ci/conformance-test-steps.yml index 87cdf035e..fd6d13992 100644 --- a/.ci/conformance-test-steps.yml +++ b/.ci/conformance-test-steps.yml @@ -11,7 +11,7 @@ steps: condition: always() inputs: buildType: 'current' - artifactName: 'Conformance.Tests-9.0-$(Agent.OS)' + artifactName: 'Conformance.Tests-10.0-$(Agent.OS)' targetPath: '$(Build.BinariesDirectory)/9.0' - task: DotNetCoreCLI@2 displayName: 'Conformance Tests' diff --git a/.ci/integration-tests-steps.yml b/.ci/integration-tests-steps.yml index db26b23ed..9b6dd8a0f 100644 --- a/.ci/integration-tests-steps.yml +++ b/.ci/integration-tests-steps.yml @@ -45,12 +45,12 @@ steps: image: ${{ parameters.image }} unsupportedFeatures: ${{ parameters.unsupportedFeatures }} connectionString: 'server=localhost;port=3300;user id=mysqltest;password=test;database=mysqltest;ssl mode=none;DefaultCommandTimeout=3600;${{ parameters.connectionStringExtra }}' - platform: 'net9.0' + platform: 'net10.0' description: 'No SSL' - template: 'integration-test-steps.yml' parameters: image: ${{ parameters.image }} unsupportedFeatures: ${{ parameters.unsupportedFeatures }} connectionString: server=localhost;port=3300;user id=mysqltest;password=test;database=mysqltest;ssl mode=required;DefaultCommandTimeout=3600;certificate file=$(Build.Repository.LocalPath)/.ci/server/certs/ssl-client.pfx;${{ parameters.connectionStringExtra }} - platform: 'net9.0' + platform: 'net10.0' description: 'SSL' diff --git a/.ci/mysqlconnector-tests-steps.yml b/.ci/mysqlconnector-tests-steps.yml index 0ddc01fc9..b4d422ccc 100644 --- a/.ci/mysqlconnector-tests-steps.yml +++ b/.ci/mysqlconnector-tests-steps.yml @@ -7,7 +7,7 @@ steps: - task: DownloadPipelineArtifact@2 inputs: buildType: 'current' - artifactName: 'MySqlConnector.Tests-9.0-$(Agent.OS)' + artifactName: 'MySqlConnector.Tests-10.0-$(Agent.OS)' targetPath: $(System.DefaultWorkingDirectory) - task: DotNetCoreCLI@2 displayName: 'Run MySqlConnector.Tests' @@ -18,7 +18,7 @@ steps: - task: DownloadPipelineArtifact@2 inputs: buildType: 'current' - artifactName: 'MySqlConnector.DependencyInjection.Tests-9.0-$(Agent.OS)' + artifactName: 'MySqlConnector.DependencyInjection.Tests-10.0-$(Agent.OS)' targetPath: $(System.DefaultWorkingDirectory) - task: DotNetCoreCLI@2 displayName: 'Run MySqlConnector.DependencyInjection.Tests' @@ -30,4 +30,4 @@ steps: inputs: testResultsFormat: VSTest testResultsFiles: '**/*.trx' - testRunTitle: 'MySqlConnector.Tests-9.0-$(Agent.OS)' + testRunTitle: 'MySqlConnector.Tests-10.0-$(Agent.OS)' diff --git a/.ci/test.ps1 b/.ci/test.ps1 index 7d595e35e..40c3615f8 100644 --- a/.ci/test.ps1 +++ b/.ci/test.ps1 @@ -38,7 +38,7 @@ dotnet test -c Release -f net462 if ($LASTEXITCODE -ne 0){ exit $LASTEXITCODE; } -dotnet test -c Release -f net9.0 +dotnet test -c Release -f net10.0 if ($LASTEXITCODE -ne 0){ exit $LASTEXITCODE; } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07726b0d0..5e686a37a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - tfm: [ 'net8.0', 'net9.0' ] + tfm: [ 'net8.0', 'net10.0' ] services: mysql: image: mysql:9.2 diff --git a/appveyor.yml b/appveyor.yml index ef905dcaa..e8dae43f0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,7 @@ install: - ps: Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "install-dotnet.ps1" - ps: .\install-dotnet.ps1 -Channel 6.0 -InstallDir "dotnetcli" - ps: .\install-dotnet.ps1 -Channel 8.0 -InstallDir "dotnetcli" - - ps: .\install-dotnet.ps1 -Channel 9.0 -InstallDir "dotnetcli" + - ps: .\install-dotnet.ps1 -Channel 10.0 -InstallDir "dotnetcli" build_script: - dotnet --info before_test: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fa4d3d285..dcfbb5370 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ variables: - DotNetCoreSdkVersion: '9.x' + DotNetCoreSdkVersion: '10.x' NUGET_PACKAGES: '$(Pipeline.Workspace)/.nuget/packages' jobs: @@ -107,18 +107,18 @@ jobs: displayName: 'Remove target frameworks' inputs: targetType: 'inline' - script: '((Get-Content .\tests\IntegrationTests\IntegrationTests.csproj -Raw) -replace(''.*'', ''net481;net9.0'')) | Set-Content .\tests\IntegrationTests\IntegrationTests.csproj' + script: '((Get-Content .\tests\IntegrationTests\IntegrationTests.csproj -Raw) -replace(''.*'', ''net481;net10.0'')) | Set-Content .\tests\IntegrationTests\IntegrationTests.csproj' - task: DotNetCoreCLI@2 displayName: 'Restore packages' inputs: command: 'restore' - task: DotNetCoreCLI@2 - displayName: 'Integration tests (net481/net9.0)' + displayName: 'Integration tests (net481/net10.0)' inputs: command: 'test' projects: 'tests/IntegrationTests/IntegrationTests.csproj' arguments: '-c Release --no-restore -p:TestTfmsInParallel=false' - testRunTitle: ${{ format('{0}, $(Agent.OS), {1}, {2}', 'mysql:8.0', 'net481/net9.0', 'No SSL') }} + testRunTitle: ${{ format('{0}, $(Agent.OS), {1}, {2}', 'mysql:8.0', 'net481/net10.0', 'No SSL') }} env: DATA__UNSUPPORTEDFEATURES: 'Ed25519,QueryAttributes,Redirection,StreamingResults,Tls11,TlsFingerprintValidation,UnixDomainSocket' DATA__CONNECTIONSTRING: 'server=localhost;port=3306;user id=mysqltest;password=test;database=mysqltest;ssl mode=none;DefaultCommandTimeout=3600;AllowPublicKeyRetrieval=True;UseCompression=True' diff --git a/global.json b/global.json index cdbb589ed..1f410abcc 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.100", + "version": "10.0.100-preview.1", "rollForward": "latestFeature" } } diff --git a/src/MySqlConnector.DependencyInjection/packages.lock.json b/src/MySqlConnector.DependencyInjection/packages.lock.json index 73ee05a17..765f6deab 100644 --- a/src/MySqlConnector.DependencyInjection/packages.lock.json +++ b/src/MySqlConnector.DependencyInjection/packages.lock.json @@ -148,9 +148,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[8.0.13, )", - "resolved": "8.0.13", - "contentHash": "R19ZTaRiQAK+xo9ZwaHbF/1vb1wwR1Wn5+sqp9v8+CDjbdS8R6qftKdw0VSXWKm7VAMi7P+NCU4zxDzhEWcAwQ==" + "requested": "[8.0.12, )", + "resolved": "8.0.12", + "contentHash": "FV4HnQ3JI15PHnJ5PGTbz+rYvrih42oLi/7UMIshNwCwUZhTq13UzrggtXk4ygrcMcN+4jsS6hhshx2p/Zd0ig==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", diff --git a/src/MySqlConnector/Logging/Log.cs b/src/MySqlConnector/Logging/Log.cs index e9b4f88bc..b5cbbed1b 100644 --- a/src/MySqlConnector/Logging/Log.cs +++ b/src/MySqlConnector/Logging/Log.cs @@ -166,10 +166,10 @@ internal static partial class Log #if NETCOREAPP3_0_OR_GREATER [LoggerMessage(EventIds.ConnectedTlsBasic, LogLevel.Debug, "Session {SessionId} connected TLS using {SslProtocol} and {NegotiatedCipherSuite}")] public static partial void ConnectedTlsBasic(ILogger logger, string sessionId, SslProtocols sslProtocol, TlsCipherSuite negotiatedCipherSuite); -#endif - +#else [LoggerMessage(EventIds.ConnectedTlsDetailed, LogLevel.Debug, "Session {SessionId} connected TLS using {SslProtocol}, {CipherAlgorithm}, {HashAlgorithm}, {KeyExchangeAlgorithm}, {KeyExchangeStrength}")] public static partial void ConnectedTlsDetailed(ILogger logger, string sessionId, SslProtocols sslProtocol, CipherAlgorithmType cipherAlgorithm, HashAlgorithmType hashAlgorithm, ExchangeAlgorithmType keyExchangeAlgorithm, int keyExchangeStrength); +#endif [LoggerMessage(EventIds.CouldNotInitializeTlsConnection, LogLevel.Error, "Session {SessionId} couldn't initialize TLS connection")] public static partial void CouldNotInitializeTlsConnection(ILogger logger, Exception exception, string sessionId); @@ -204,10 +204,10 @@ internal static partial class Log #if NETCOREAPP3_0_OR_GREATER [LoggerMessage(EventIds.ConnectedTlsBasicPreliminary, LogLevel.Debug, "Session {SessionId} provisionally connected TLS with error {SslPolicyErrors} using {SslProtocol} and {NegotiatedCipherSuite}")] public static partial void ConnectedTlsBasicPreliminary(ILogger logger, string sessionId, SslPolicyErrors sslPolicyErrors, SslProtocols sslProtocol, TlsCipherSuite negotiatedCipherSuite); -#endif - +#else [LoggerMessage(EventIds.ConnectedTlsDetailedPreliminary, LogLevel.Debug, "Session {SessionId} provisionally connected TLS with error {SslPolicyErrors} using {SslProtocol}, {CipherAlgorithm}, {HashAlgorithm}, {KeyExchangeAlgorithm}, {KeyExchangeStrength}")] public static partial void ConnectedTlsDetailedPreliminary(ILogger logger, string sessionId, SslPolicyErrors sslPolicyErrors, SslProtocols sslProtocol, CipherAlgorithmType cipherAlgorithm, HashAlgorithmType hashAlgorithm, ExchangeAlgorithmType keyExchangeAlgorithm, int keyExchangeStrength); +#endif [LoggerMessage(EventIds.CertificateErrorUnixSocket, LogLevel.Trace, "Session {SessionId} ignoring remote certificate error {SslPolicyErrors} due to Unix socket connection")] public static partial void CertificateErrorUnixSocket(ILogger logger, string sessionId, SslPolicyErrors sslPolicyErrors); diff --git a/src/MySqlConnector/MySqlConnector.csproj b/src/MySqlConnector/MySqlConnector.csproj index 023a6e28e..0baa1a010 100644 --- a/src/MySqlConnector/MySqlConnector.csproj +++ b/src/MySqlConnector/MySqlConnector.csproj @@ -1,7 +1,7 @@ - net462;net471;net48;netstandard2.0;netstandard2.1;net6.0;net8.0;net9.0 + net462;net471;net48;netstandard2.0;netstandard2.1;net6.0;net8.0;net9.0;net10.0 A truly async MySQL ADO.NET provider, supporting MySQL Server, MariaDB, Amazon Aurora, Azure Database for MySQL, Google Cloud SQL, and more. Copyright 2016–2024 Bradley Grainger Bradley Grainger diff --git a/src/MySqlConnector/packages.lock.json b/src/MySqlConnector/packages.lock.json index 3fc5d7c53..69ce45b7f 100644 --- a/src/MySqlConnector/packages.lock.json +++ b/src/MySqlConnector/packages.lock.json @@ -300,15 +300,6 @@ "System.Memory": "4.5.5" } }, - "Microsoft.NETFramework.ReferenceAssemblies": { - "type": "Direct", - "requested": "[1.0.3, )", - "resolved": "1.0.3", - "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", - "dependencies": { - "Microsoft.NETFramework.ReferenceAssemblies.net48": "1.0.3" - } - }, "Microsoft.SourceLink.GitHub": { "type": "Direct", "requested": "[8.0.0, )", @@ -366,11 +357,6 @@ "resolved": "8.0.0", "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" }, - "Microsoft.NETFramework.ReferenceAssemblies.net48": { - "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ==" - }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -561,9 +547,7 @@ "contentHash": "nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", "dependencies": { "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2", - "System.Buffers": "4.5.1", - "System.Diagnostics.DiagnosticSource": "8.0.1", - "System.Memory": "4.5.5" + "System.Diagnostics.DiagnosticSource": "8.0.1" } }, "Microsoft.SourceLink.GitHub": { @@ -597,7 +581,6 @@ "resolved": "8.0.1", "contentHash": "vaoWjvkG1aenR2XdjaVivlCV9fADfgyhW5bZtXT23qaEea0lWiUljdQuze4E31vKM7ZWJaSUsbYIKE3rnzfZUg==", "dependencies": { - "System.Memory": "4.5.5", "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, @@ -616,30 +599,73 @@ "resolved": "1.2.0.556", "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" }, - "System.Buffers": { + "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "CentralTransitive", + "requested": "[8.0.2, )", + "resolved": "8.0.2", + "contentHash": "3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==" + } + }, + "net10.0": { + "Microsoft.Extensions.Logging.Abstractions": { + "type": "Direct", + "requested": "[8.0.2, )", + "resolved": "8.0.2", + "contentHash": "nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" } }, - "System.Numerics.Vectors": { + "Microsoft.NET.ILLink.Tasks": { + "type": "Direct", + "requested": "[10.0.0-preview.1.25080.5, )", + "resolved": "10.0.0-preview.1.25080.5", + "contentHash": "vQBoEgri9joy6o8c/MJl7kHdgLYPgm81AZtDIvs6wkd2E/x1p7EvwllOBVQ1ZVF5wRjjxtKu0tBwcjk8av2+1Q==" + }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, + "MinVer": { + "type": "Direct", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g==" + }, + "StyleCop.Analyzers": { + "type": "Direct", + "requested": "[1.2.0-beta.556, )", + "resolved": "1.2.0-beta.556", + "contentHash": "llRPgmA1fhC0I0QyFLEcjvtM2239QzKr/tcnbsjArLMJxJlu0AA5G7Fft0OI30pHF3MW63Gf4aSSsjc5m82J1Q==", + "dependencies": { + "StyleCop.Analyzers.Unstable": "1.2.0.556" + } + }, + "Microsoft.Build.Tasks.Git": { "type": "Transitive", - "resolved": "4.4.0", - "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" }, - "System.Runtime.CompilerServices.Unsafe": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, + "StyleCop.Analyzers.Unstable": { + "type": "Transitive", + "resolved": "1.2.0.556", + "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "CentralTransitive", @@ -688,10 +714,7 @@ "type": "Direct", "requested": "[8.0.1, )", "resolved": "8.0.1", - "contentHash": "vaoWjvkG1aenR2XdjaVivlCV9fADfgyhW5bZtXT23qaEea0lWiUljdQuze4E31vKM7ZWJaSUsbYIKE3rnzfZUg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } + "contentHash": "vaoWjvkG1aenR2XdjaVivlCV9fADfgyhW5bZtXT23qaEea0lWiUljdQuze4E31vKM7ZWJaSUsbYIKE3rnzfZUg==" }, "Microsoft.Build.Tasks.Git": { "type": "Transitive", @@ -708,11 +731,6 @@ "resolved": "1.2.0.556", "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "CentralTransitive", "requested": "[8.0.2, )", @@ -732,9 +750,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[8.0.13, )", - "resolved": "8.0.13", - "contentHash": "R19ZTaRiQAK+xo9ZwaHbF/1vb1wwR1Wn5+sqp9v8+CDjbdS8R6qftKdw0VSXWKm7VAMi7P+NCU4zxDzhEWcAwQ==" + "requested": "[8.0.12, )", + "resolved": "8.0.12", + "contentHash": "FV4HnQ3JI15PHnJ5PGTbz+rYvrih42oLi/7UMIshNwCwUZhTq13UzrggtXk4ygrcMcN+4jsS6hhshx2p/Zd0ig==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", @@ -795,9 +813,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[9.0.2, )", - "resolved": "9.0.2", - "contentHash": "+KFnCLVPicEq99ko0tq+ycTvNLXHw0tImmTZjPloB/DOFLPT56KLfk5aS7wbgXRPzYhXTTBYLGaABea5mke77w==" + "requested": "[9.0.1, )", + "resolved": "9.0.1", + "contentHash": "BKFAkdhUUJivAoKuSWcT23WH9E+AWQMJootzt9X+lnesOD2a2yNIe1ZQFtxB8H3ayskLBD5gYyIbj5GIfw7rZg==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", diff --git a/tests/Conformance.Tests/Conformance.Tests.csproj b/tests/Conformance.Tests/Conformance.Tests.csproj index e2a4ca928..289f2b5f1 100644 --- a/tests/Conformance.Tests/Conformance.Tests.csproj +++ b/tests/Conformance.Tests/Conformance.Tests.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 0.1.0 true true diff --git a/tests/Conformance.Tests/packages.lock.json b/tests/Conformance.Tests/packages.lock.json index 0bd8e590e..34c0ce579 100644 --- a/tests/Conformance.Tests/packages.lock.json +++ b/tests/Conformance.Tests/packages.lock.json @@ -1,7 +1,7 @@ { "version": 2, "dependencies": { - "net9.0": { + "net10.0": { "AdoNet.Specification.Tests": { "type": "Direct", "requested": "[2.0.0-beta.2, )", @@ -97,10 +97,7 @@ "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", "resolved": "17.12.0", - "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } + "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==" }, "Microsoft.TestPlatform.TestHost": { "type": "Transitive", @@ -121,11 +118,6 @@ "resolved": "1.2.0.556", "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, "Validation": { "type": "Transitive", "resolved": "2.4.18", diff --git a/tests/IntegrationTests/IntegrationTests.csproj b/tests/IntegrationTests/IntegrationTests.csproj index bb388f662..7127ab248 100644 --- a/tests/IntegrationTests/IntegrationTests.csproj +++ b/tests/IntegrationTests/IntegrationTests.csproj @@ -1,12 +1,12 @@ - net462;net481;net6.0;net8.0;net9.0 + net462;net481;net6.0;net8.0;net10.0 false - net9.0 + net10.0 MYSQL_DATA $(NoWarn);MSB3246 @@ -41,7 +41,6 @@ - diff --git a/tests/IntegrationTests/packages.lock.json b/tests/IntegrationTests/packages.lock.json index ccd66edad..59173537f 100644 --- a/tests/IntegrationTests/packages.lock.json +++ b/tests/IntegrationTests/packages.lock.json @@ -83,22 +83,6 @@ "StyleCop.Analyzers.Unstable": "1.2.0.556" } }, - "System.Text.Json": { - "type": "Direct", - "requested": "[9.0.1, )", - "resolved": "9.0.1", - "contentHash": "eqWHDZqYPv1PvuvoIIx5pF74plL3iEOZOl/0kQP+Y0TEbtgNnM2W6k8h8EPYs+LTJZsXuWa92n5W5sHTWvE3VA==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "9.0.1", - "System.Buffers": "4.5.1", - "System.IO.Pipelines": "9.0.1", - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "9.0.1", - "System.Threading.Tasks.Extensions": "4.5.4", - "System.ValueTuple": "4.5.0" - } - }, "xunit": { "type": "Direct", "requested": "[2.9.3, )", @@ -371,6 +355,22 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "System.Text.Json": { + "type": "CentralTransitive", + "requested": "[9.0.1, )", + "resolved": "9.0.1", + "contentHash": "eqWHDZqYPv1PvuvoIIx5pF74plL3iEOZOl/0kQP+Y0TEbtgNnM2W6k8h8EPYs+LTJZsXuWa92n5W5sHTWvE3VA==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "9.0.1", + "System.Buffers": "4.5.1", + "System.IO.Pipelines": "9.0.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "9.0.1", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + } + }, "System.Threading.Tasks.Extensions": { "type": "CentralTransitive", "requested": "[4.5.4, )", @@ -463,22 +463,6 @@ "StyleCop.Analyzers.Unstable": "1.2.0.556" } }, - "System.Text.Json": { - "type": "Direct", - "requested": "[9.0.1, )", - "resolved": "9.0.1", - "contentHash": "eqWHDZqYPv1PvuvoIIx5pF74plL3iEOZOl/0kQP+Y0TEbtgNnM2W6k8h8EPYs+LTJZsXuWa92n5W5sHTWvE3VA==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "9.0.1", - "System.Buffers": "4.5.1", - "System.IO.Pipelines": "9.0.1", - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "9.0.1", - "System.Threading.Tasks.Extensions": "4.5.4", - "System.ValueTuple": "4.5.0" - } - }, "xunit": { "type": "Direct", "requested": "[2.9.3, )", @@ -751,6 +735,22 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "System.Text.Json": { + "type": "CentralTransitive", + "requested": "[9.0.1, )", + "resolved": "9.0.1", + "contentHash": "eqWHDZqYPv1PvuvoIIx5pF74plL3iEOZOl/0kQP+Y0TEbtgNnM2W6k8h8EPYs+LTJZsXuWa92n5W5sHTWvE3VA==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "9.0.1", + "System.Buffers": "4.5.1", + "System.IO.Pipelines": "9.0.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "9.0.1", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + } + }, "System.Threading.Tasks.Extensions": { "type": "CentralTransitive", "requested": "[4.5.4, )", @@ -761,7 +761,7 @@ } } }, - "net6.0": { + "net10.0": { "Dapper.StrongName": { "type": "Direct", "requested": "[2.1.35, )", @@ -796,8 +796,7 @@ "Microsoft.Extensions.Configuration": "8.0.0", "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", "Microsoft.Extensions.Configuration.FileExtensions": "8.0.1", - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "System.Text.Json": "8.0.5" + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0" } }, "Microsoft.NET.Test.Sdk": { @@ -835,21 +834,6 @@ "StyleCop.Analyzers.Unstable": "1.2.0.556" } }, - "System.Text.Json": { - "type": "Direct", - "requested": "[9.0.1, )", - "resolved": "9.0.1", - "contentHash": "eqWHDZqYPv1PvuvoIIx5pF74plL3iEOZOl/0kQP+Y0TEbtgNnM2W6k8h8EPYs+LTJZsXuWa92n5W5sHTWvE3VA==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "9.0.1", - "System.Buffers": "4.5.1", - "System.IO.Pipelines": "9.0.1", - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "9.0.1", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, "xunit": { "type": "Direct", "requested": "[2.9.3, )", @@ -867,11 +851,6 @@ "resolved": "2.8.2", "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "9.0.1", - "contentHash": "IVkmUqf+KzbuXKrxi2tyQlg11RArYk26t2eU5cHekff+7Ao09vH8vt8idC0BJSMnpiRV2OK66zM2EwJU6Tm5Cw==" - }, "Microsoft.Build.Tasks.Git": { "type": "Transitive", "resolved": "8.0.0", @@ -937,10 +916,7 @@ "Microsoft.Extensions.Primitives": { "type": "Transitive", "resolved": "8.0.0", - "contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } + "contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==" }, "Microsoft.SourceLink.Common": { "type": "Transitive", @@ -950,10 +926,7 @@ "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", "resolved": "17.12.0", - "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } + "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==" }, "Microsoft.TestPlatform.TestHost": { "type": "Transitive", @@ -974,46 +947,6 @@ "resolved": "1.2.0.556", "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.IO.Pipelines": { - "type": "Transitive", - "resolved": "9.0.1", - "contentHash": "uXf5o8eV/gtzDQY4lGROLFMWQvcViKcF8o4Q6KpIOjloAQXrnscQSu6gTxYJMHuNJnh7szIF9AzkaEq+zDLoEg==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "9.0.1", - "contentHash": "XkspqduP2t1e1x2vBUAD/xZ5ZDvmywuUwsmB93MvyQLospJfqtX0GsR/kU0vUL2h4kmvf777z3txV2W4NrQ9Qg==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, "xunit.abstractions": { "type": "Transitive", "resolved": "2.0.3", @@ -1057,8 +990,7 @@ "mysqlconnector": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[8.0.2, )", - "System.Diagnostics.DiagnosticSource": "[8.0.1, )" + "Microsoft.Extensions.Logging.Abstractions": "[8.0.2, )" } }, "mysqlconnector.authentication.ed25519": { @@ -1079,27 +1011,11 @@ "resolved": "8.0.2", "contentHash": "nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2", - "System.Diagnostics.DiagnosticSource": "8.0.1" - } - }, - "System.Diagnostics.DiagnosticSource": { - "type": "CentralTransitive", - "requested": "[8.0.1, )", - "resolved": "8.0.1", - "contentHash": "vaoWjvkG1aenR2XdjaVivlCV9fADfgyhW5bZtXT23qaEea0lWiUljdQuze4E31vKM7ZWJaSUsbYIKE3rnzfZUg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" } - }, - "System.Threading.Tasks.Extensions": { - "type": "CentralTransitive", - "requested": "[4.5.4, )", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" } }, - "net8.0": { + "net6.0": { "Dapper.StrongName": { "type": "Direct", "requested": "[2.1.35, )", @@ -1134,7 +1050,8 @@ "Microsoft.Extensions.Configuration": "8.0.0", "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", "Microsoft.Extensions.Configuration.FileExtensions": "8.0.1", - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0" + "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", + "System.Text.Json": "8.0.5" } }, "Microsoft.NET.Test.Sdk": { @@ -1172,16 +1089,6 @@ "StyleCop.Analyzers.Unstable": "1.2.0.556" } }, - "System.Text.Json": { - "type": "Direct", - "requested": "[9.0.1, )", - "resolved": "9.0.1", - "contentHash": "eqWHDZqYPv1PvuvoIIx5pF74plL3iEOZOl/0kQP+Y0TEbtgNnM2W6k8h8EPYs+LTJZsXuWa92n5W5sHTWvE3VA==", - "dependencies": { - "System.IO.Pipelines": "9.0.1", - "System.Text.Encodings.Web": "9.0.1" - } - }, "xunit": { "type": "Direct", "requested": "[2.9.3, )", @@ -1199,6 +1106,11 @@ "resolved": "2.8.2", "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "9.0.1", + "contentHash": "IVkmUqf+KzbuXKrxi2tyQlg11RArYk26t2eU5cHekff+7Ao09vH8vt8idC0BJSMnpiRV2OK66zM2EwJU6Tm5Cw==" + }, "Microsoft.Build.Tasks.Git": { "type": "Transitive", "resolved": "8.0.0", @@ -1274,10 +1186,7 @@ "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", "resolved": "17.12.0", - "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } + "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==" }, "Microsoft.TestPlatform.TestHost": { "type": "Transitive", @@ -1303,11 +1212,6 @@ "resolved": "9.0.1", "contentHash": "uXf5o8eV/gtzDQY4lGROLFMWQvcViKcF8o4Q6KpIOjloAQXrnscQSu6gTxYJMHuNJnh7szIF9AzkaEq+zDLoEg==" }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, "System.Text.Encodings.Web": { "type": "Transitive", "resolved": "9.0.1", @@ -1356,7 +1260,8 @@ "mysqlconnector": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[8.0.2, )" + "Microsoft.Extensions.Logging.Abstractions": "[8.0.2, )", + "System.Diagnostics.DiagnosticSource": "[8.0.1, )" } }, "mysqlconnector.authentication.ed25519": { @@ -1377,11 +1282,29 @@ "resolved": "8.0.2", "contentHash": "nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2" + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2", + "System.Diagnostics.DiagnosticSource": "8.0.1" + } + }, + "System.Diagnostics.DiagnosticSource": { + "type": "CentralTransitive", + "requested": "[8.0.1, )", + "resolved": "8.0.1", + "contentHash": "vaoWjvkG1aenR2XdjaVivlCV9fADfgyhW5bZtXT23qaEea0lWiUljdQuze4E31vKM7ZWJaSUsbYIKE3rnzfZUg==" + }, + "System.Text.Json": { + "type": "CentralTransitive", + "requested": "[9.0.1, )", + "resolved": "9.0.1", + "contentHash": "eqWHDZqYPv1PvuvoIIx5pF74plL3iEOZOl/0kQP+Y0TEbtgNnM2W6k8h8EPYs+LTJZsXuWa92n5W5sHTWvE3VA==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "9.0.1", + "System.IO.Pipelines": "9.0.1", + "System.Text.Encodings.Web": "9.0.1" } } }, - "net9.0": { + "net8.0": { "Dapper.StrongName": { "type": "Direct", "requested": "[2.1.35, )", @@ -1454,12 +1377,6 @@ "StyleCop.Analyzers.Unstable": "1.2.0.556" } }, - "System.Text.Json": { - "type": "Direct", - "requested": "[9.0.1, )", - "resolved": "9.0.1", - "contentHash": "eqWHDZqYPv1PvuvoIIx5pF74plL3iEOZOl/0kQP+Y0TEbtgNnM2W6k8h8EPYs+LTJZsXuWa92n5W5sHTWvE3VA==" - }, "xunit": { "type": "Direct", "requested": "[2.9.3, )", @@ -1552,10 +1469,7 @@ "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", "resolved": "17.12.0", - "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } + "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==" }, "Microsoft.TestPlatform.TestHost": { "type": "Transitive", @@ -1576,11 +1490,6 @@ "resolved": "1.2.0.556", "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, "xunit.abstractions": { "type": "Transitive", "resolved": "2.0.3", diff --git a/tests/MySqlConnector.DependencyInjection.Tests/MySqlConnector.DependencyInjection.Tests.csproj b/tests/MySqlConnector.DependencyInjection.Tests/MySqlConnector.DependencyInjection.Tests.csproj index ebeeef845..c14cde477 100644 --- a/tests/MySqlConnector.DependencyInjection.Tests/MySqlConnector.DependencyInjection.Tests.csproj +++ b/tests/MySqlConnector.DependencyInjection.Tests/MySqlConnector.DependencyInjection.Tests.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 true true ..\..\MySqlConnector.snk diff --git a/tests/MySqlConnector.DependencyInjection.Tests/packages.lock.json b/tests/MySqlConnector.DependencyInjection.Tests/packages.lock.json index 0d8fc35b6..89260d032 100644 --- a/tests/MySqlConnector.DependencyInjection.Tests/packages.lock.json +++ b/tests/MySqlConnector.DependencyInjection.Tests/packages.lock.json @@ -1,7 +1,7 @@ { "version": 2, "dependencies": { - "net9.0": { + "net10.0": { "Microsoft.Extensions.DependencyInjection": { "type": "Direct", "requested": "[8.0.1, )", diff --git a/tests/MySqlConnector.NativeAot.Tests/MySqlConnector.NativeAot.Tests.csproj b/tests/MySqlConnector.NativeAot.Tests/MySqlConnector.NativeAot.Tests.csproj index 3797dedb8..f9d651b2b 100644 --- a/tests/MySqlConnector.NativeAot.Tests/MySqlConnector.NativeAot.Tests.csproj +++ b/tests/MySqlConnector.NativeAot.Tests/MySqlConnector.NativeAot.Tests.csproj @@ -2,7 +2,7 @@ Exe - net8.0;net9.0 + net8.0;net10.0 enable enable true diff --git a/tests/MySqlConnector.NativeAot.Tests/packages.lock.json b/tests/MySqlConnector.NativeAot.Tests/packages.lock.json index b75c400e8..db45bc473 100644 --- a/tests/MySqlConnector.NativeAot.Tests/packages.lock.json +++ b/tests/MySqlConnector.NativeAot.Tests/packages.lock.json @@ -1,18 +1,18 @@ { "version": 2, "dependencies": { - "net8.0": { + "net10.0": { "Microsoft.DotNet.ILCompiler": { "type": "Direct", - "requested": "[8.0.13, )", - "resolved": "8.0.13", - "contentHash": "CCIhseY9KUJDIYKt7qD1IRLQA6Hr/8Dky31KS6UrM2sFyaFUb2JLagT0Uy2BiSf1i1Qy3nPjRb0zc1JFogOi9w==" + "requested": "[10.0.0-preview.1.25080.5, )", + "resolved": "10.0.0-preview.1.25080.5", + "contentHash": "Yzl7RSJ+Vz7srQV2OCp9pZq/f8M6VUFpVNzRleeDqxmXVcNWLE6RDBu4rcRmIe4VCmNX6pxq8/nrR4sulUfPSw==" }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[8.0.13, )", - "resolved": "8.0.13", - "contentHash": "R19ZTaRiQAK+xo9ZwaHbF/1vb1wwR1Wn5+sqp9v8+CDjbdS8R6qftKdw0VSXWKm7VAMi7P+NCU4zxDzhEWcAwQ==" + "requested": "[10.0.0-preview.1.25080.5, )", + "resolved": "10.0.0-preview.1.25080.5", + "contentHash": "vQBoEgri9joy6o8c/MJl7kHdgLYPgm81AZtDIvs6wkd2E/x1p7EvwllOBVQ1ZVF5wRjjxtKu0tBwcjk8av2+1Q==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", @@ -83,18 +83,18 @@ } } }, - "net9.0": { + "net8.0": { "Microsoft.DotNet.ILCompiler": { "type": "Direct", - "requested": "[9.0.2, )", - "resolved": "9.0.2", - "contentHash": "eyIUUqqPy7brzmoV04zabOUm0puEAAjZd3O3vuzan9iTTh0oIPwts8fLxZFoEZCFi63ACFtHbNBs5Y7myB3ZDQ==" + "requested": "[8.0.12, )", + "resolved": "8.0.12", + "contentHash": "zhXnz2574mBc/ocGoG+qB0BgyoK9bH7f7Te1fNQJGbpwLLwZO5KKaTBmfM8N8THb3a2vQVFonbBzQ//d15TmQQ==" }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[9.0.2, )", - "resolved": "9.0.2", - "contentHash": "+KFnCLVPicEq99ko0tq+ycTvNLXHw0tImmTZjPloB/DOFLPT56KLfk5aS7wbgXRPzYhXTTBYLGaABea5mke77w==" + "requested": "[8.0.12, )", + "resolved": "8.0.12", + "contentHash": "FV4HnQ3JI15PHnJ5PGTbz+rYvrih42oLi/7UMIshNwCwUZhTq13UzrggtXk4ygrcMcN+4jsS6hhshx2p/Zd0ig==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", diff --git a/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj b/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj index b375b14ae..770710f29 100644 --- a/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj +++ b/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj @@ -1,7 +1,7 @@ - net481;net9.0 + net481;net10.0 diff --git a/tests/MySqlConnector.Tests/packages.lock.json b/tests/MySqlConnector.Tests/packages.lock.json index 5cea0042c..63f84e59d 100644 --- a/tests/MySqlConnector.Tests/packages.lock.json +++ b/tests/MySqlConnector.Tests/packages.lock.json @@ -234,7 +234,7 @@ } } }, - "net9.0": { + "net10.0": { "Microsoft.NET.Test.Sdk": { "type": "Direct", "requested": "[17.12.0, )", @@ -305,10 +305,7 @@ "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", "resolved": "17.12.0", - "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==", - "dependencies": { - "System.Reflection.Metadata": "1.6.0" - } + "contentHash": "TDqkTKLfQuAaPcEb3pDDWnh7b3SyZF+/W9OZvWFp6eJCIiiYFdSB6taE2I6tWrFw5ywhzOb6sreoGJTI6m3rSQ==" }, "Microsoft.TestPlatform.TestHost": { "type": "Transitive", @@ -329,11 +326,6 @@ "resolved": "1.2.0.556", "contentHash": "zvn9Mqs/ox/83cpYPignI8hJEM2A93s2HkHs8HYMOAQW0PkampyoErAiIyKxgTLqbbad29HX/shv/6LGSjPJNQ==" }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, "xunit.abstractions": { "type": "Transitive", "resolved": "2.0.3", diff --git a/tools/SchemaCollectionGenerator/SchemaCollectionGenerator.csproj b/tools/SchemaCollectionGenerator/SchemaCollectionGenerator.csproj index 85c1ed799..cfbfc836c 100644 --- a/tools/SchemaCollectionGenerator/SchemaCollectionGenerator.csproj +++ b/tools/SchemaCollectionGenerator/SchemaCollectionGenerator.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable enable true diff --git a/tools/SchemaCollectionGenerator/packages.lock.json b/tools/SchemaCollectionGenerator/packages.lock.json index c76e60b00..eef5da70b 100644 --- a/tools/SchemaCollectionGenerator/packages.lock.json +++ b/tools/SchemaCollectionGenerator/packages.lock.json @@ -1,7 +1,7 @@ { "version": 2, "dependencies": { - "net9.0": { + "net10.0": { "Microsoft.SourceLink.GitHub": { "type": "Direct", "requested": "[8.0.0, )", From 7164557cac00527f9abd350df0f4c87ad9850698 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Tue, 18 Mar 2025 13:26:56 -0700 Subject: [PATCH 02/14] Build with .NET 10 Preview 2. --- .../packages.lock.json | 6 ++--- src/MySqlConnector/packages.lock.json | 18 +++++++------- .../packages.lock.json | 24 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/MySqlConnector.DependencyInjection/packages.lock.json b/src/MySqlConnector.DependencyInjection/packages.lock.json index 765f6deab..73ee05a17 100644 --- a/src/MySqlConnector.DependencyInjection/packages.lock.json +++ b/src/MySqlConnector.DependencyInjection/packages.lock.json @@ -148,9 +148,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[8.0.12, )", - "resolved": "8.0.12", - "contentHash": "FV4HnQ3JI15PHnJ5PGTbz+rYvrih42oLi/7UMIshNwCwUZhTq13UzrggtXk4ygrcMcN+4jsS6hhshx2p/Zd0ig==" + "requested": "[8.0.13, )", + "resolved": "8.0.13", + "contentHash": "R19ZTaRiQAK+xo9ZwaHbF/1vb1wwR1Wn5+sqp9v8+CDjbdS8R6qftKdw0VSXWKm7VAMi7P+NCU4zxDzhEWcAwQ==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", diff --git a/src/MySqlConnector/packages.lock.json b/src/MySqlConnector/packages.lock.json index 69ce45b7f..fba3cc108 100644 --- a/src/MySqlConnector/packages.lock.json +++ b/src/MySqlConnector/packages.lock.json @@ -623,9 +623,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[10.0.0-preview.1.25080.5, )", - "resolved": "10.0.0-preview.1.25080.5", - "contentHash": "vQBoEgri9joy6o8c/MJl7kHdgLYPgm81AZtDIvs6wkd2E/x1p7EvwllOBVQ1ZVF5wRjjxtKu0tBwcjk8av2+1Q==" + "requested": "[10.0.0-preview.2.25163.2, )", + "resolved": "10.0.0-preview.2.25163.2", + "contentHash": "Dy8UsVWQoxrxRNqyCxBKXKkW5AvsYaZgV4MGaAEMfM0/Fmut7Ok9uPSD7jPU05YezHyRzN/a24s2bOkhpuWWMA==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", @@ -750,9 +750,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[8.0.12, )", - "resolved": "8.0.12", - "contentHash": "FV4HnQ3JI15PHnJ5PGTbz+rYvrih42oLi/7UMIshNwCwUZhTq13UzrggtXk4ygrcMcN+4jsS6hhshx2p/Zd0ig==" + "requested": "[8.0.13, )", + "resolved": "8.0.13", + "contentHash": "R19ZTaRiQAK+xo9ZwaHbF/1vb1wwR1Wn5+sqp9v8+CDjbdS8R6qftKdw0VSXWKm7VAMi7P+NCU4zxDzhEWcAwQ==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", @@ -813,9 +813,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[9.0.1, )", - "resolved": "9.0.1", - "contentHash": "BKFAkdhUUJivAoKuSWcT23WH9E+AWQMJootzt9X+lnesOD2a2yNIe1ZQFtxB8H3ayskLBD5gYyIbj5GIfw7rZg==" + "requested": "[9.0.2, )", + "resolved": "9.0.2", + "contentHash": "+KFnCLVPicEq99ko0tq+ycTvNLXHw0tImmTZjPloB/DOFLPT56KLfk5aS7wbgXRPzYhXTTBYLGaABea5mke77w==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", diff --git a/tests/MySqlConnector.NativeAot.Tests/packages.lock.json b/tests/MySqlConnector.NativeAot.Tests/packages.lock.json index db45bc473..3c612c4f2 100644 --- a/tests/MySqlConnector.NativeAot.Tests/packages.lock.json +++ b/tests/MySqlConnector.NativeAot.Tests/packages.lock.json @@ -4,15 +4,15 @@ "net10.0": { "Microsoft.DotNet.ILCompiler": { "type": "Direct", - "requested": "[10.0.0-preview.1.25080.5, )", - "resolved": "10.0.0-preview.1.25080.5", - "contentHash": "Yzl7RSJ+Vz7srQV2OCp9pZq/f8M6VUFpVNzRleeDqxmXVcNWLE6RDBu4rcRmIe4VCmNX6pxq8/nrR4sulUfPSw==" + "requested": "[10.0.0-preview.2.25163.2, )", + "resolved": "10.0.0-preview.2.25163.2", + "contentHash": "+JRHbVrldTFQD60jdeo2GaYzKYf1or9b+HYFK7Uo6rvhWpgqoaaA68+Bi7/cUr67jmIMDj9P5IW4+BNeLxoopA==" }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[10.0.0-preview.1.25080.5, )", - "resolved": "10.0.0-preview.1.25080.5", - "contentHash": "vQBoEgri9joy6o8c/MJl7kHdgLYPgm81AZtDIvs6wkd2E/x1p7EvwllOBVQ1ZVF5wRjjxtKu0tBwcjk8av2+1Q==" + "requested": "[10.0.0-preview.2.25163.2, )", + "resolved": "10.0.0-preview.2.25163.2", + "contentHash": "Dy8UsVWQoxrxRNqyCxBKXKkW5AvsYaZgV4MGaAEMfM0/Fmut7Ok9uPSD7jPU05YezHyRzN/a24s2bOkhpuWWMA==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", @@ -86,15 +86,15 @@ "net8.0": { "Microsoft.DotNet.ILCompiler": { "type": "Direct", - "requested": "[8.0.12, )", - "resolved": "8.0.12", - "contentHash": "zhXnz2574mBc/ocGoG+qB0BgyoK9bH7f7Te1fNQJGbpwLLwZO5KKaTBmfM8N8THb3a2vQVFonbBzQ//d15TmQQ==" + "requested": "[8.0.13, )", + "resolved": "8.0.13", + "contentHash": "CCIhseY9KUJDIYKt7qD1IRLQA6Hr/8Dky31KS6UrM2sFyaFUb2JLagT0Uy2BiSf1i1Qy3nPjRb0zc1JFogOi9w==" }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[8.0.12, )", - "resolved": "8.0.12", - "contentHash": "FV4HnQ3JI15PHnJ5PGTbz+rYvrih42oLi/7UMIshNwCwUZhTq13UzrggtXk4ygrcMcN+4jsS6hhshx2p/Zd0ig==" + "requested": "[8.0.13, )", + "resolved": "8.0.13", + "contentHash": "R19ZTaRiQAK+xo9ZwaHbF/1vb1wwR1Wn5+sqp9v8+CDjbdS8R6qftKdw0VSXWKm7VAMi7P+NCU4zxDzhEWcAwQ==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", From ab02ad27af5f5d5d7f4cbe2209562cd4832fcfc3 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Sat, 19 Apr 2025 11:24:53 -0700 Subject: [PATCH 03/14] Update SDK to .NET 10 Preview 3. --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index fda0cd1ea..8b236e749 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100-preview.2", + "version": "10.0.100-preview.3", "rollForward": "latestFeature" } } From 3b415b4e2d37f13a86cace30fb4dd9f2f573c0f4 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Sat, 17 May 2025 12:35:00 -0700 Subject: [PATCH 04/14] Update SDK to .NET 10 Preview 4. --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 8b236e749..eb5dc781d 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100-preview.3", + "version": "10.0.100-preview.4", "rollForward": "latestFeature" } } From d56de1ac81a6ce855b923287badbd2ddeed58e1e Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Tue, 10 Jun 2025 14:24:15 -0700 Subject: [PATCH 05/14] Use .NET 10 Preview 5. --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index eb5dc781d..80b513689 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100-preview.4", + "version": "10.0.100-preview.5", "rollForward": "latestFeature" } } From f32297b9034c1bd1afb69dfdeaf20c2cc47a8709 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Wed, 11 Jun 2025 18:35:14 -0700 Subject: [PATCH 06/14] Suppress CA2025 analyzer. This is causing NullReferenceException errors during the build. https://github.com/dotnet/roslyn-analyzers/issues/7652#issuecomment-2961614195 --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index 4a511abec..13ff74547 100644 --- a/.editorconfig +++ b/.editorconfig @@ -83,6 +83,7 @@ dotnet_diagnostic.CA1510.severity = none # Use ArgumentNullException.ThrowIfNull dotnet_diagnostic.CA1513.severity = none # Use ObjectDisposedException.ThrowIf. dotnet_diagnostic.CA1849.severity = none # Call async methods when in an async method. dotnet_diagnostic.CA2000.severity = none # Use recommended Dispose pattern. +dotnet_diagnostic.CA2025.severity = none # Do not pass 'IDisposable' instances into unawaited tasks - https://github.com/dotnet/roslyn-analyzers/issues/7652#issuecomment-2961614195 dotnet_diagnostic.CA2100.severity = none # Review SQL queries for security vulnerabilities. dotnet_diagnostic.CA2213.severity = silent # Disposable fields should be disposed. dotnet_diagnostic.CA5398.severity = none # Avoid hardcoded SslProtocols values. From 0f38da20abc501d9c0ee74e0d9c37b32da6e3fe8 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Tue, 15 Jul 2025 19:42:48 -0700 Subject: [PATCH 07/14] Use .NET 10 Preview 6. --- Directory.Build.props | 2 +- global.json | 2 +- tests/Benchmark/Benchmark.csproj | 1 - tests/Conformance.Tests/Conformance.Tests.csproj | 1 - tests/IntegrationTests/IntegrationTests.csproj | 1 - tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj | 1 - 6 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 10bca8b48..51cd9b224 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ true - preview + 13.0 true $(NoWarn);1591;CA1708;CA1835;CA2215;CA5397;NU5105;SYSLIB0039 $(MSBuildThisFileDirectory)artifacts diff --git a/global.json b/global.json index 80b513689..9575d0c8b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100-preview.5", + "version": "10.0.100-preview.6", "rollForward": "latestFeature" } } diff --git a/tests/Benchmark/Benchmark.csproj b/tests/Benchmark/Benchmark.csproj index c872995fc..2c8666d15 100644 --- a/tests/Benchmark/Benchmark.csproj +++ b/tests/Benchmark/Benchmark.csproj @@ -2,7 +2,6 @@ Exe net8.0 - 12.0 false diff --git a/tests/Conformance.Tests/Conformance.Tests.csproj b/tests/Conformance.Tests/Conformance.Tests.csproj index 289f2b5f1..8e24e47e9 100644 --- a/tests/Conformance.Tests/Conformance.Tests.csproj +++ b/tests/Conformance.Tests/Conformance.Tests.csproj @@ -7,7 +7,6 @@ true ..\..\MySqlConnector.snk true - 11.0 diff --git a/tests/IntegrationTests/IntegrationTests.csproj b/tests/IntegrationTests/IntegrationTests.csproj index 7127ab248..c3a0d6346 100644 --- a/tests/IntegrationTests/IntegrationTests.csproj +++ b/tests/IntegrationTests/IntegrationTests.csproj @@ -23,7 +23,6 @@ true true 64 - 11.0 enable $(NoWarn);SA0001;SA1021;SA1133;xUnit1030 diff --git a/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj b/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj index 770710f29..ed06b6a88 100644 --- a/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj +++ b/tests/MySqlConnector.Tests/MySqlConnector.Tests.csproj @@ -15,7 +15,6 @@ true ..\..\MySqlConnector.snk true - 12.0 $(NoWarn);SA1021 From b7670b3ab1cc732a8fbea5bf55d285f8fc5a99cf Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Sat, 30 Aug 2025 11:39:48 -0700 Subject: [PATCH 08/14] Use .NET 10 Preview 7. --- global.json | 2 +- src/MySqlConnector/Core/ServerSession.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 9575d0c8b..c9b808802 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100-preview.6", + "version": "10.0.100-preview.7", "rollForward": "latestFeature" } } diff --git a/src/MySqlConnector/Core/ServerSession.cs b/src/MySqlConnector/Core/ServerSession.cs index 2cf197e1a..b4317c75e 100644 --- a/src/MySqlConnector/Core/ServerSession.cs +++ b/src/MySqlConnector/Core/ServerSession.cs @@ -1905,7 +1905,7 @@ private bool ShouldGetRealServerDetails(ConnectionSettings cs) // detect AWS RDS Proxy, if hostname like .proxy-..rds.amazonaws.com if (HostName.EndsWith(".rds.amazonaws.com", StringComparison.OrdinalIgnoreCase) && - HostName.Contains(".proxy-", StringComparison.OrdinalIgnoreCase)) + HostName.AsSpan().Contains(".proxy-".AsSpan(), StringComparison.OrdinalIgnoreCase)) { return true; } From aa2a8a4be35c4373b398206ada2ba88929ae1981 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Tue, 9 Sep 2025 13:46:33 -0700 Subject: [PATCH 09/14] Use .NET 10 RC 1. --- global.json | 2 +- tests/MySqlConnector.Tests/ByteBufferWriterTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index c9b808802..bfd519ce9 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100-preview.7", + "version": "10.0.100-rc.1", "rollForward": "latestFeature" } } diff --git a/tests/MySqlConnector.Tests/ByteBufferWriterTests.cs b/tests/MySqlConnector.Tests/ByteBufferWriterTests.cs index 01beb3aba..dd61190d1 100644 --- a/tests/MySqlConnector.Tests/ByteBufferWriterTests.cs +++ b/tests/MySqlConnector.Tests/ByteBufferWriterTests.cs @@ -22,6 +22,6 @@ public void WriteString(int length) var input = char.ConvertFromUtf32(0xE001); for (var i = 0; i < length; i++) writer.Write(input); - Assert.Equal(expected, writer.ArraySegment); + Assert.Equal(expected, writer.ArraySegment.ToArray()); } } From cde4cdbda1d6f90fbfa3348a67faa7f7d7b790e4 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Tue, 9 Sep 2025 14:06:39 -0700 Subject: [PATCH 10/14] Use C# 14 'field' syntax for setters. --- Directory.Build.props | 2 +- src/MySqlConnector/MySqlBatch.cs | 5 ++--- src/MySqlConnector/MySqlCommand.cs | 27 ++++++++++++--------------- src/MySqlConnector/MySqlParameter.cs | 11 +++++------ 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 51cd9b224..1fed69cf4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ true - 13.0 + 14.0 true $(NoWarn);1591;CA1708;CA1835;CA2215;CA5397;NU5105;SYSLIB0039 $(MSBuildThisFileDirectory)artifacts diff --git a/src/MySqlConnector/MySqlBatch.cs b/src/MySqlConnector/MySqlBatch.cs index 17528b552..02cb415be 100644 --- a/src/MySqlConnector/MySqlBatch.cs +++ b/src/MySqlConnector/MySqlBatch.cs @@ -199,10 +199,10 @@ public Task ExecuteNonQueryAsync(CancellationToken cancellationToken = defa #endif int Timeout { - get => m_timeout; + get; set { - m_timeout = value; + field = value; ((ICancellableCommand) this).EffectiveCommandTimeout = null; } } @@ -412,7 +412,6 @@ private bool IsPrepared private readonly int m_commandId; private bool m_isDisposed; - private int m_timeout; private Action? m_cancelAction; private Action? m_cancelForCommandTimeoutAction; private uint m_cancelTimerId; diff --git a/src/MySqlConnector/MySqlCommand.cs b/src/MySqlConnector/MySqlCommand.cs index 0e72806c3..ff8f127e1 100644 --- a/src/MySqlConnector/MySqlCommand.cs +++ b/src/MySqlConnector/MySqlCommand.cs @@ -59,7 +59,7 @@ public MySqlCommand(string? commandText, MySqlConnection? connection, MySqlTrans { GC.SuppressFinalize(this); m_commandId = ICancellableCommandExtensions.GetNextId(); - m_commandText = commandText ?? ""; + CommandText = commandText ?? ""; Connection = connection; Transaction = transaction; CommandType = CommandType.Text; @@ -71,7 +71,7 @@ private MySqlCommand(MySqlCommand other) GC.SuppressFinalize(this); m_commandTimeout = other.m_commandTimeout; ((ICancellableCommand) this).EffectiveCommandTimeout = null; - m_commandType = other.m_commandType; + CommandType = other.CommandType; DesignTimeVisible = other.DesignTimeVisible; UpdatedRowSource = other.UpdatedRowSource; m_parameterCollection = other.CloneRawParameters(); @@ -200,12 +200,12 @@ private bool NeedsPrepare(out Exception? exception) [AllowNull] public override string CommandText { - get => m_commandText; + get; set { - if (m_connection?.ActiveCommandId == m_commandId) + if (Connection?.ActiveCommandId == m_commandId) throw new InvalidOperationException("Cannot set MySqlCommand.CommandText when there is an open DataReader for this command; it must be closed first."); - m_commandText = value ?? ""; + field = value ?? ""; } } @@ -215,12 +215,12 @@ public override string CommandText public new MySqlConnection? Connection { - get => m_connection; + get; set { - if (m_connection?.ActiveCommandId == m_commandId) + if (field?.ActiveCommandId == m_commandId) throw new InvalidOperationException("Cannot set MySqlCommand.Connection when there is an open DataReader for this command; it must be closed first."); - m_connection = value; + field = value; } } @@ -244,12 +244,12 @@ public override int CommandTimeout /// public override CommandType CommandType { - get => m_commandType; + get; set { if (value is not CommandType.Text and not CommandType.StoredProcedure) throw new ArgumentException("CommandType must be Text or StoredProcedure.", nameof(value)); - m_commandType = value; + field = value; } } @@ -454,8 +454,8 @@ private bool IsValid([NotNullWhen(false)] out Exception? exception) return exception is null; } - PreparedStatements? IMySqlCommand.TryGetPreparedStatements() => CommandType == CommandType.Text && !string.IsNullOrWhiteSpace(CommandText) && m_connection is not null && - m_connection.State == ConnectionState.Open ? m_connection.Session.TryGetPreparedStatement(CommandText!) : null; + PreparedStatements? IMySqlCommand.TryGetPreparedStatements() => CommandType == CommandType.Text && !string.IsNullOrWhiteSpace(CommandText) && Connection is not null && + Connection.State == ConnectionState.Open ? Connection.Session.TryGetPreparedStatement(CommandText!) : null; CommandBehavior IMySqlCommand.CommandBehavior => m_commandBehavior; MySqlParameterCollection? IMySqlCommand.OutParameters { get; set; } @@ -464,12 +464,9 @@ private bool IsValid([NotNullWhen(false)] out Exception? exception) private readonly int m_commandId; private bool m_isDisposed; - private MySqlConnection? m_connection; - private string m_commandText; private MySqlParameterCollection? m_parameterCollection; private MySqlAttributeCollection? m_attributeCollection; private int? m_commandTimeout; - private CommandType m_commandType; private CommandBehavior m_commandBehavior; private Action? m_cancelAction; private Action? m_cancelForCommandTimeoutAction; diff --git a/src/MySqlConnector/MySqlParameter.cs b/src/MySqlConnector/MySqlParameter.cs index b217eb814..9d6e32863 100644 --- a/src/MySqlConnector/MySqlParameter.cs +++ b/src/MySqlConnector/MySqlParameter.cs @@ -29,7 +29,7 @@ public MySqlParameter(string? name, object? value) m_name = name ?? ""; NormalizedParameterName = NormalizeParameterName(m_name); Value = value; - m_sourceColumn = ""; + SourceColumn = ""; SourceVersion = DataRowVersion.Current; } @@ -49,7 +49,7 @@ public MySqlParameter(string name, MySqlDbType mySqlDbType, int size, string sou NormalizedParameterName = NormalizeParameterName(m_name); MySqlDbType = mySqlDbType; Size = size; - m_sourceColumn = sourceColumn ?? ""; + SourceColumn = sourceColumn ?? ""; SourceVersion = DataRowVersion.Current; } @@ -123,8 +123,8 @@ public override string ParameterName [AllowNull] public override string SourceColumn { - get => m_sourceColumn; - set => m_sourceColumn = value ?? ""; + get; + set => field = value ?? ""; } public override bool SourceColumnNullMapping { get; set; } @@ -175,7 +175,7 @@ private MySqlParameter(MySqlParameter other) m_value = other.m_value; Precision = other.Precision; Scale = other.Scale; - m_sourceColumn = other.m_sourceColumn; + SourceColumn = other.SourceColumn; SourceColumnNullMapping = other.SourceColumnNullMapping; SourceVersion = other.SourceVersion; } @@ -1034,6 +1034,5 @@ private static ReadOnlySpan ConvertFloatsToBytes(ReadOnlySpan float private MySqlDbType m_mySqlDbType; private string m_name; private ParameterDirection? m_direction; - private string m_sourceColumn; private object? m_value; } From 36f750cad8619c2d356ad9fdce71fb7e90c6ca49 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Tue, 9 Sep 2025 15:53:43 -0700 Subject: [PATCH 11/14] Use Convert.FromHexString. --- src/MySqlConnector/Core/ServerSession.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/MySqlConnector/Core/ServerSession.cs b/src/MySqlConnector/Core/ServerSession.cs index b4317c75e..b6f58edf6 100644 --- a/src/MySqlConnector/Core/ServerSession.cs +++ b/src/MySqlConnector/Core/ServerSession.cs @@ -1,3 +1,4 @@ +using System.Buffers; using System.Buffers.Text; using System.ComponentModel; using System.Diagnostics; @@ -686,6 +687,9 @@ private bool ValidateFingerprint(byte[]? validationHash, ReadOnlySpan chal static bool TryConvertFromHexString(ReadOnlySpan hexChars, Span data) { +#if NET10_0_OR_GREATER + return Convert.FromHexString(hexChars, data, out _, out _) == OperationStatus.Done; +#else ReadOnlySpan hexDigits = "0123456789ABCDEFabcdef"u8; for (var i = 0; i < hexChars.Length; i += 2) { @@ -700,6 +704,7 @@ static bool TryConvertFromHexString(ReadOnlySpan hexChars, Span data data[i / 2] = (byte) ((high << 4) | low); } return true; +#endif } } From 901df6d495998371c371b8c0e9f34327873bb166 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Fri, 12 Sep 2025 15:02:38 -0700 Subject: [PATCH 12/14] Polyfill ThrowIfNull static method. --- .../Authentication/AuthenticationPlugins.cs | 5 --- src/MySqlConnector/Core/ResultSet.cs | 5 --- src/MySqlConnector/Core/Row.cs | 5 --- src/MySqlConnector/Core/SchemaProvider.g.cs | 5 --- src/MySqlConnector/Core/SqlParser.cs | 5 --- src/MySqlConnector/ExceptionExtensions.cs | 23 ++++++++++++ .../MySqlAttributeCollection.cs | 5 --- src/MySqlConnector/MySqlBulkCopy.cs | 35 ------------------- src/MySqlConnector/MySqlCommandBuilder.cs | 5 --- src/MySqlConnector/MySqlConnection.cs | 15 -------- src/MySqlConnector/MySqlDataSourceBuilder.cs | 5 --- src/MySqlConnector/MySqlHelper.cs | 5 --- src/MySqlConnector/MySqlParameter.cs | 5 --- .../MySqlParameterCollection.cs | 15 -------- src/MySqlConnector/MySqlTransaction.cs | 5 --- .../Serialization/StandardPayloadHandler.cs | 5 --- .../Utilities/CallerAttributes.cs | 10 ++++++ .../SchemaCollectionGenerator.cs | 5 --- 18 files changed, 33 insertions(+), 130 deletions(-) create mode 100644 src/MySqlConnector/ExceptionExtensions.cs create mode 100644 src/MySqlConnector/Utilities/CallerAttributes.cs diff --git a/src/MySqlConnector/Authentication/AuthenticationPlugins.cs b/src/MySqlConnector/Authentication/AuthenticationPlugins.cs index 92fdf19c7..537c7509d 100644 --- a/src/MySqlConnector/Authentication/AuthenticationPlugins.cs +++ b/src/MySqlConnector/Authentication/AuthenticationPlugins.cs @@ -13,12 +13,7 @@ public static class AuthenticationPlugins /// The authentication plugin. public static void Register(IAuthenticationPlugin plugin) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(plugin); -#else - if (plugin is null) - throw new ArgumentNullException(nameof(plugin)); -#endif #if NET8_0_OR_GREATER ArgumentException.ThrowIfNullOrEmpty(plugin.Name); #else diff --git a/src/MySqlConnector/Core/ResultSet.cs b/src/MySqlConnector/Core/ResultSet.cs index dd535c66b..216844821 100644 --- a/src/MySqlConnector/Core/ResultSet.cs +++ b/src/MySqlConnector/Core/ResultSet.cs @@ -331,12 +331,7 @@ public bool HasRows public int GetOrdinal(string name) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(name); -#else - if (name is null) - throw new ArgumentNullException(nameof(name)); -#endif if (!HasResultSet) throw new InvalidOperationException("There is no current result set."); diff --git a/src/MySqlConnector/Core/Row.cs b/src/MySqlConnector/Core/Row.cs index a9f424c9d..b94e36c4a 100644 --- a/src/MySqlConnector/Core/Row.cs +++ b/src/MySqlConnector/Core/Row.cs @@ -424,12 +424,7 @@ public MySqlDecimal GetMySqlDecimal(int ordinal) public int GetValues(object[] values) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(values); -#else - if (values is null) - throw new ArgumentNullException(nameof(values)); -#endif int count = Math.Min(values.Length, ResultSet.ColumnDefinitions!.Length); for (int i = 0; i < count; i++) values[i] = GetValue(i); diff --git a/src/MySqlConnector/Core/SchemaProvider.g.cs b/src/MySqlConnector/Core/SchemaProvider.g.cs index adacc5473..f287b7ab4 100644 --- a/src/MySqlConnector/Core/SchemaProvider.g.cs +++ b/src/MySqlConnector/Core/SchemaProvider.g.cs @@ -9,12 +9,7 @@ internal sealed partial class SchemaProvider { public async ValueTask GetSchemaAsync(IOBehavior ioBehavior, string collectionName, string?[]? restrictionValues, CancellationToken cancellationToken) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(collectionName); -#else - if (collectionName is null) - throw new ArgumentNullException(nameof(collectionName)); -#endif var dataTable = new DataTable(); if (string.Equals(collectionName, "MetaDataCollections", StringComparison.OrdinalIgnoreCase)) diff --git a/src/MySqlConnector/Core/SqlParser.cs b/src/MySqlConnector/Core/SqlParser.cs index de08d26ff..4155a62d0 100644 --- a/src/MySqlConnector/Core/SqlParser.cs +++ b/src/MySqlConnector/Core/SqlParser.cs @@ -8,12 +8,7 @@ internal abstract class SqlParser(StatementPreparer preparer) public void Parse(string sql) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(sql); -#else - if (sql is null) - throw new ArgumentNullException(nameof(sql)); -#endif OnBeforeParse(sql); int parameterStartIndex = -1; diff --git a/src/MySqlConnector/ExceptionExtensions.cs b/src/MySqlConnector/ExceptionExtensions.cs new file mode 100644 index 000000000..580e253ba --- /dev/null +++ b/src/MySqlConnector/ExceptionExtensions.cs @@ -0,0 +1,23 @@ +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; + +namespace MySqlConnector; + +internal static class ExceptionExtensions +{ +#if !NET6_0_OR_GREATER + // https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/ArgumentNullException.cs + extension(ArgumentNullException) + { + /// Throws an if is null. + /// The reference type argument to validate as non-null. + /// The name of the parameter with which corresponds. + /// From https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/ArgumentNullException.cs. + public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression("argument")] string? paramName = null) + { + if (argument is null) + throw new ArgumentNullException(paramName); + } + } +#endif +} diff --git a/src/MySqlConnector/MySqlAttributeCollection.cs b/src/MySqlConnector/MySqlAttributeCollection.cs index cd7c7c273..12d3846e7 100644 --- a/src/MySqlConnector/MySqlAttributeCollection.cs +++ b/src/MySqlConnector/MySqlAttributeCollection.cs @@ -19,12 +19,7 @@ public sealed class MySqlAttributeCollection : IEnumerable /// The attribute name must not be empty, and must not already exist in the collection. public void Add(MySqlAttribute attribute) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(attribute); -#else - if (attribute is null) - throw new ArgumentNullException(nameof(attribute)); -#endif #if NET8_0_OR_GREATER ArgumentException.ThrowIfNullOrEmpty(attribute.AttributeName); #else diff --git a/src/MySqlConnector/MySqlBulkCopy.cs b/src/MySqlConnector/MySqlBulkCopy.cs index de4ccb8e5..4eb2eb4a8 100644 --- a/src/MySqlConnector/MySqlBulkCopy.cs +++ b/src/MySqlConnector/MySqlBulkCopy.cs @@ -52,12 +52,7 @@ public sealed class MySqlBulkCopy /// (Optional) The to use. public MySqlBulkCopy(MySqlConnection connection, MySqlTransaction? transaction = null) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(connection); -#else - if (connection is null) - throw new ArgumentNullException(nameof(connection)); -#endif m_connection = connection; m_transaction = transaction; m_logger = m_connection.LoggingConfiguration.BulkCopyLogger; @@ -117,12 +112,7 @@ public MySqlBulkCopy(MySqlConnection connection, MySqlTransaction? transaction = /// A with the result of the bulk copy operation. public MySqlBulkCopyResult WriteToServer(DataTable dataTable) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(dataTable); -#else - if (dataTable is null) - throw new ArgumentNullException(nameof(dataTable)); -#endif m_valuesEnumerator = DataRowsValuesEnumerator.Create(dataTable); #pragma warning disable CA2012 // Safe because method completes synchronously return WriteToServerAsync(IOBehavior.Synchronous, CancellationToken.None).GetAwaiter().GetResult(); @@ -138,12 +128,7 @@ public MySqlBulkCopyResult WriteToServer(DataTable dataTable) /// A with the result of the bulk copy operation. public async ValueTask WriteToServerAsync(DataTable dataTable, CancellationToken cancellationToken = default) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(dataTable); -#else - if (dataTable is null) - throw new ArgumentNullException(nameof(dataTable)); -#endif m_valuesEnumerator = DataRowsValuesEnumerator.Create(dataTable); return await WriteToServerAsync(IOBehavior.Asynchronous, cancellationToken).ConfigureAwait(false); } @@ -158,12 +143,7 @@ public async ValueTask WriteToServerAsync(DataTable dataTab /// A with the result of the bulk copy operation. public MySqlBulkCopyResult WriteToServer(IEnumerable dataRows, int columnCount) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(dataRows); -#else - if (dataRows is null) - throw new ArgumentNullException(nameof(dataRows)); -#endif m_valuesEnumerator = new DataRowsValuesEnumerator(dataRows, columnCount); #pragma warning disable CA2012 // Safe because method completes synchronously return WriteToServerAsync(IOBehavior.Synchronous, CancellationToken.None).GetAwaiter().GetResult(); @@ -181,12 +161,7 @@ public MySqlBulkCopyResult WriteToServer(IEnumerable dataRows, int colu /// A with the result of the bulk copy operation. public async ValueTask WriteToServerAsync(IEnumerable dataRows, int columnCount, CancellationToken cancellationToken = default) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(dataRows); -#else - if (dataRows is null) - throw new ArgumentNullException(nameof(dataRows)); -#endif m_valuesEnumerator = new DataRowsValuesEnumerator(dataRows, columnCount); return await WriteToServerAsync(IOBehavior.Asynchronous, cancellationToken).ConfigureAwait(false); } @@ -199,12 +174,7 @@ public async ValueTask WriteToServerAsync(IEnumerableA with the result of the bulk copy operation. public MySqlBulkCopyResult WriteToServer(IDataReader dataReader) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(dataReader); -#else - if (dataReader is null) - throw new ArgumentNullException(nameof(dataReader)); -#endif m_valuesEnumerator = DataReaderValuesEnumerator.Create(dataReader); #pragma warning disable CA2012 // Safe because method completes synchronously return WriteToServerAsync(IOBehavior.Synchronous, CancellationToken.None).GetAwaiter().GetResult(); @@ -220,12 +190,7 @@ public MySqlBulkCopyResult WriteToServer(IDataReader dataReader) /// A with the result of the bulk copy operation. public async ValueTask WriteToServerAsync(IDataReader dataReader, CancellationToken cancellationToken = default) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(dataReader); -#else - if (dataReader is null) - throw new ArgumentNullException(nameof(dataReader)); -#endif m_valuesEnumerator = DataReaderValuesEnumerator.Create(dataReader); return await WriteToServerAsync(IOBehavior.Asynchronous, cancellationToken).ConfigureAwait(false); } diff --git a/src/MySqlConnector/MySqlCommandBuilder.cs b/src/MySqlConnector/MySqlCommandBuilder.cs index 7b63dd5ef..cf37b628b 100644 --- a/src/MySqlConnector/MySqlCommandBuilder.cs +++ b/src/MySqlConnector/MySqlCommandBuilder.cs @@ -12,12 +12,7 @@ public sealed class MySqlCommandBuilder : DbCommandBuilder private static async Task DeriveParametersAsync(IOBehavior ioBehavior, MySqlCommand command, CancellationToken cancellationToken) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(command); -#else - if (command is null) - throw new ArgumentNullException(nameof(command)); -#endif if (command.CommandType != CommandType.StoredProcedure) throw new ArgumentException($"MySqlCommand.CommandType must be StoredProcedure not {command.CommandType}", nameof(command)); if (string.IsNullOrWhiteSpace(command.CommandText)) diff --git a/src/MySqlConnector/MySqlConnection.cs b/src/MySqlConnector/MySqlConnection.cs index 62f70bdac..b2f8cac2a 100644 --- a/src/MySqlConnector/MySqlConnection.cs +++ b/src/MySqlConnector/MySqlConnection.cs @@ -433,12 +433,7 @@ internal void UnenlistTransaction() private void TakeSessionFrom(MySqlConnection other) { #if DEBUG -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(other); -#else - if (other is null) - throw new ArgumentNullException(nameof(other)); -#endif if (m_session is not null) throw new InvalidOperationException("This connection must not have a session"); if (other.m_session is null) @@ -713,12 +708,7 @@ public override string ConnectionString private static async Task ClearPoolAsync(MySqlConnection connection, IOBehavior ioBehavior, CancellationToken cancellationToken) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(connection); -#else - if (connection is null) - throw new ArgumentNullException(nameof(connection)); -#endif var pool = ConnectionPool.GetPool(connection.m_connectionString, null, createIfNotFound: false); if (pool is not null) @@ -1036,12 +1026,7 @@ internal void Cancel(ICancellableCommand command, int commandId, bool isCancel) internal void SetActiveReader(MySqlDataReader dataReader) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(dataReader); -#else - if (dataReader is null) - throw new ArgumentNullException(nameof(dataReader)); -#endif if (m_activeReader is not null) throw new InvalidOperationException("Can't replace active reader."); m_activeReader = dataReader; diff --git a/src/MySqlConnector/MySqlDataSourceBuilder.cs b/src/MySqlConnector/MySqlDataSourceBuilder.cs index 5ea16dce0..8c284a34b 100644 --- a/src/MySqlConnector/MySqlDataSourceBuilder.cs +++ b/src/MySqlConnector/MySqlDataSourceBuilder.cs @@ -27,12 +27,7 @@ public MySqlDataSourceBuilder(string? connectionString = null) /// This builder, so that method calls can be chained. public MySqlDataSourceBuilder ConfigureTracing(Action configureAction) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(configureAction); -#else - if (configureAction is null) - throw new ArgumentNullException(nameof(configureAction)); -#endif m_tracingOptionsBuilderCallbacks ??= []; m_tracingOptionsBuilderCallbacks.Add(configureAction); return this; diff --git a/src/MySqlConnector/MySqlHelper.cs b/src/MySqlConnector/MySqlHelper.cs index e78090a9c..f4922a97b 100644 --- a/src/MySqlConnector/MySqlHelper.cs +++ b/src/MySqlConnector/MySqlHelper.cs @@ -12,12 +12,7 @@ public sealed class MySqlHelper /// public static string EscapeString(string value) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(value); -#else - if (value is null) - throw new ArgumentNullException(nameof(value)); -#endif StringBuilder? sb = null; int last = -1; diff --git a/src/MySqlConnector/MySqlParameter.cs b/src/MySqlConnector/MySqlParameter.cs index 9d6e32863..b255a32cd 100644 --- a/src/MySqlConnector/MySqlParameter.cs +++ b/src/MySqlConnector/MySqlParameter.cs @@ -183,12 +183,7 @@ private MySqlParameter(MySqlParameter other) private MySqlParameter(MySqlParameter other, string parameterName) : this(other) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(parameterName); -#else - if (parameterName is null) - throw new ArgumentNullException(nameof(parameterName)); -#endif ParameterName = parameterName; } diff --git a/src/MySqlConnector/MySqlParameterCollection.cs b/src/MySqlConnector/MySqlParameterCollection.cs index e9012d37e..c6de237f3 100644 --- a/src/MySqlConnector/MySqlParameterCollection.cs +++ b/src/MySqlConnector/MySqlParameterCollection.cs @@ -25,24 +25,14 @@ public MySqlParameter Add(string parameterName, DbType dbType) public override int Add(object value) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(value); -#else - if (value is null) - throw new ArgumentNullException(nameof(value)); -#endif AddParameter((MySqlParameter) value, m_parameters.Count); return m_parameters.Count - 1; } public MySqlParameter Add(MySqlParameter parameter) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(parameter); -#else - if (parameter is null) - throw new ArgumentNullException(nameof(parameter)); -#endif AddParameter(parameter, m_parameters.Count); return parameter; } @@ -135,12 +125,7 @@ public override void RemoveAt(int index) protected override void SetParameter(int index, DbParameter value) { -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(value); -#else - if (value is null) - throw new ArgumentNullException(nameof(value)); -#endif var newParameter = (MySqlParameter) value; var oldParameter = m_parameters[index]; if (oldParameter.NormalizedParameterName is not null) diff --git a/src/MySqlConnector/MySqlTransaction.cs b/src/MySqlConnector/MySqlTransaction.cs index 4896d357c..d0e50e8a0 100644 --- a/src/MySqlConnector/MySqlTransaction.cs +++ b/src/MySqlConnector/MySqlTransaction.cs @@ -153,12 +153,7 @@ private async Task ExecuteSavepointAsync(string command, string savepointName, I { VerifyValid(); -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(savepointName); -#else - if (savepointName is null) - throw new ArgumentNullException(nameof(savepointName)); -#endif #if NET8_0_OR_GREATER ArgumentException.ThrowIfNullOrEmpty(savepointName); #else diff --git a/src/MySqlConnector/Protocol/Serialization/StandardPayloadHandler.cs b/src/MySqlConnector/Protocol/Serialization/StandardPayloadHandler.cs index 6650dc563..ff46aef8b 100644 --- a/src/MySqlConnector/Protocol/Serialization/StandardPayloadHandler.cs +++ b/src/MySqlConnector/Protocol/Serialization/StandardPayloadHandler.cs @@ -37,12 +37,7 @@ public IByteHandler ByteHandler set { var oldByteHandler = m_byteHandler; -#if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(value); -#else - if (value is null) - throw new ArgumentNullException(nameof(value)); -#endif m_byteHandler = value; oldByteHandler?.Dispose(); m_bufferedByteReader = new(); diff --git a/src/MySqlConnector/Utilities/CallerAttributes.cs b/src/MySqlConnector/Utilities/CallerAttributes.cs new file mode 100644 index 000000000..c550fb87b --- /dev/null +++ b/src/MySqlConnector/Utilities/CallerAttributes.cs @@ -0,0 +1,10 @@ +#if !NET6_0_OR_GREATER +namespace System.Runtime.CompilerServices; + +// https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CallerArgumentExpressionAttribute.cs +[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] +internal sealed class CallerArgumentExpressionAttribute(string parameterName) : Attribute +{ + public string ParameterName { get; } = parameterName; +} +#endif diff --git a/tools/SchemaCollectionGenerator/SchemaCollectionGenerator.cs b/tools/SchemaCollectionGenerator/SchemaCollectionGenerator.cs index 549267aa4..f2658dab0 100644 --- a/tools/SchemaCollectionGenerator/SchemaCollectionGenerator.cs +++ b/tools/SchemaCollectionGenerator/SchemaCollectionGenerator.cs @@ -25,12 +25,7 @@ internal sealed partial class SchemaProvider { public async ValueTask GetSchemaAsync(IOBehavior ioBehavior, string collectionName, string?[]? restrictionValues, CancellationToken cancellationToken) { - #if NET6_0_OR_GREATER ArgumentNullException.ThrowIfNull(collectionName); - #else - if (collectionName is null) - throw new ArgumentNullException(nameof(collectionName)); - #endif var dataTable = new DataTable(); """); From b293858f0c0532933a357064cefe5339d0b0f305 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Fri, 12 Sep 2025 15:08:38 -0700 Subject: [PATCH 13/14] Polyfill ThrowIfNullOrEmpty static method. --- .../Authentication/AuthenticationPlugins.cs | 5 ----- src/MySqlConnector/ExceptionExtensions.cs | 19 +++++++++++++++++++ .../MySqlAttributeCollection.cs | 10 ---------- src/MySqlConnector/MySqlTransaction.cs | 5 ----- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/MySqlConnector/Authentication/AuthenticationPlugins.cs b/src/MySqlConnector/Authentication/AuthenticationPlugins.cs index 537c7509d..bc168348e 100644 --- a/src/MySqlConnector/Authentication/AuthenticationPlugins.cs +++ b/src/MySqlConnector/Authentication/AuthenticationPlugins.cs @@ -14,12 +14,7 @@ public static class AuthenticationPlugins public static void Register(IAuthenticationPlugin plugin) { ArgumentNullException.ThrowIfNull(plugin); -#if NET8_0_OR_GREATER ArgumentException.ThrowIfNullOrEmpty(plugin.Name); -#else - if (string.IsNullOrEmpty(plugin.Name)) - throw new ArgumentException("Invalid plugin name.", nameof(plugin)); -#endif lock (s_lock) s_plugins.Add(plugin.Name, plugin); } diff --git a/src/MySqlConnector/ExceptionExtensions.cs b/src/MySqlConnector/ExceptionExtensions.cs index 580e253ba..99efe778d 100644 --- a/src/MySqlConnector/ExceptionExtensions.cs +++ b/src/MySqlConnector/ExceptionExtensions.cs @@ -5,6 +5,25 @@ namespace MySqlConnector; internal static class ExceptionExtensions { +#if !NET8_0_OR_GREATER + // https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/ArgumentException.cs + extension(ArgumentException) + { + /// Throws an exception if is null or empty. + /// The string argument to validate as non-null and non-empty. + /// The name of the parameter with which corresponds. + /// is null. + /// is empty. + public static void ThrowIfNullOrEmpty([NotNull] string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) + { + if (argument is null) + throw new ArgumentNullException(paramName); + if (argument.Length == 0) + throw new ArgumentException("The string must not be empty.", paramName); + } + } +#endif + #if !NET6_0_OR_GREATER // https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/ArgumentNullException.cs extension(ArgumentNullException) diff --git a/src/MySqlConnector/MySqlAttributeCollection.cs b/src/MySqlConnector/MySqlAttributeCollection.cs index 12d3846e7..8dfa93073 100644 --- a/src/MySqlConnector/MySqlAttributeCollection.cs +++ b/src/MySqlConnector/MySqlAttributeCollection.cs @@ -20,12 +20,7 @@ public sealed class MySqlAttributeCollection : IEnumerable public void Add(MySqlAttribute attribute) { ArgumentNullException.ThrowIfNull(attribute); -#if NET8_0_OR_GREATER ArgumentException.ThrowIfNullOrEmpty(attribute.AttributeName); -#else - if (string.IsNullOrEmpty(attribute.AttributeName)) - throw new ArgumentException("Attribute name must not be empty", nameof(attribute)); -#endif foreach (var existingAttribute in m_attributes) { if (existingAttribute.AttributeName == attribute.AttributeName) @@ -41,12 +36,7 @@ public void Add(MySqlAttribute attribute) /// The attribute value. public void SetAttribute(string attributeName, object? value) { -#if NET8_0_OR_GREATER ArgumentException.ThrowIfNullOrEmpty(attributeName); -#else - if (string.IsNullOrEmpty(attributeName)) - throw new ArgumentException("Attribute name must not be empty", nameof(attributeName)); -#endif for (var i = 0; i < m_attributes.Count; i++) { if (m_attributes[i].AttributeName == attributeName) diff --git a/src/MySqlConnector/MySqlTransaction.cs b/src/MySqlConnector/MySqlTransaction.cs index d0e50e8a0..6cd76f8e7 100644 --- a/src/MySqlConnector/MySqlTransaction.cs +++ b/src/MySqlConnector/MySqlTransaction.cs @@ -154,12 +154,7 @@ private async Task ExecuteSavepointAsync(string command, string savepointName, I VerifyValid(); ArgumentNullException.ThrowIfNull(savepointName); -#if NET8_0_OR_GREATER ArgumentException.ThrowIfNullOrEmpty(savepointName); -#else - if (savepointName.Length == 0) - throw new ArgumentException("savepointName must not be empty", nameof(savepointName)); -#endif using var cmd = new MySqlCommand(command + "savepoint " + QuoteIdentifier(savepointName), Connection, this) { NoActivity = true }; await cmd.ExecuteNonQueryAsync(ioBehavior, cancellationToken).ConfigureAwait(false); From e6299cdcc3998b0d752c8e457e19aa658c6e06c1 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Fri, 12 Sep 2025 15:21:05 -0700 Subject: [PATCH 14/14] Polyfill ArgumentOutOfRangeException static helpers. --- src/MySqlConnector/Core/Row.cs | 22 +------- src/MySqlConnector/ExceptionExtensions.cs | 56 +++++++++++++++++++ src/MySqlConnector/MySqlCommand.cs | 5 -- .../Protocol/Serialization/ByteArrayReader.cs | 15 ----- src/MySqlConnector/Utilities/TimerQueue.cs | 5 -- 5 files changed, 58 insertions(+), 45 deletions(-) diff --git a/src/MySqlConnector/Core/Row.cs b/src/MySqlConnector/Core/Row.cs index b94e36c4a..6e671eee1 100644 --- a/src/MySqlConnector/Core/Row.cs +++ b/src/MySqlConnector/Core/Row.cs @@ -77,13 +77,8 @@ public void SetData(ReadOnlyMemory data) public object GetValue(int ordinal) { -#if NET8_0_OR_GREATER ArgumentOutOfRangeException.ThrowIfNegative(ordinal); ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(ordinal, ResultSet.ColumnDefinitions!.Length); -#else - if (ordinal < 0 || ordinal >= ResultSet.ColumnDefinitions!.Length) - throw new ArgumentOutOfRangeException(nameof(ordinal), $"value must be between 0 and {ResultSet.ColumnDefinitions!.Length - 1}"); -#endif if (m_dataOffsetLengths[ordinal].Offset == -1) return DBNull.Value; @@ -235,8 +230,8 @@ public short GetInt16(int ordinal) public int GetInt32(int ordinal) { - if (ordinal < 0 || ordinal >= ResultSet.ColumnDefinitions!.Length) - throw new ArgumentOutOfRangeException(nameof(ordinal), $"value must be between 0 and {ResultSet.ColumnDefinitions!.Length - 1}"); + ArgumentOutOfRangeException.ThrowIfNegative(ordinal); + ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(ordinal, ResultSet.ColumnDefinitions!.Length); if (m_dataOffsetLengths[ordinal].Offset == -1) throw new InvalidCastException("Can't convert NULL to Int32"); @@ -458,24 +453,11 @@ private void CheckBinaryColumn(int ordinal) private static void CheckBufferArguments(long dataOffset, T[] buffer, int bufferOffset, int length) { -#if NET8_0_OR_GREATER ArgumentOutOfRangeException.ThrowIfNegative(dataOffset); ArgumentOutOfRangeException.ThrowIfGreaterThan(dataOffset, int.MaxValue); ArgumentOutOfRangeException.ThrowIfNegative(length); ArgumentOutOfRangeException.ThrowIfNegative(bufferOffset); ArgumentOutOfRangeException.ThrowIfGreaterThan(bufferOffset, buffer.Length); -#else - if (dataOffset < 0) - throw new ArgumentOutOfRangeException(nameof(dataOffset), dataOffset, nameof(dataOffset) + " must be non-negative"); - if (dataOffset > int.MaxValue) - throw new ArgumentOutOfRangeException(nameof(dataOffset), dataOffset, nameof(dataOffset) + " must be a 32-bit integer"); - if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length), length, nameof(length) + " must be non-negative"); - if (bufferOffset < 0) - throw new ArgumentOutOfRangeException(nameof(bufferOffset), bufferOffset, nameof(bufferOffset) + " must be non-negative"); - if (bufferOffset > buffer.Length) - throw new ArgumentOutOfRangeException(nameof(bufferOffset), bufferOffset, nameof(bufferOffset) + " must be within the buffer"); -#endif if (checked(bufferOffset + length) > buffer.Length) throw new ArgumentException(nameof(bufferOffset) + " + " + nameof(length) + " cannot exceed " + nameof(buffer) + "." + nameof(buffer.Length), nameof(length)); } diff --git a/src/MySqlConnector/ExceptionExtensions.cs b/src/MySqlConnector/ExceptionExtensions.cs index 99efe778d..003509119 100644 --- a/src/MySqlConnector/ExceptionExtensions.cs +++ b/src/MySqlConnector/ExceptionExtensions.cs @@ -39,4 +39,60 @@ public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpres } } #endif + +#if !NET8_0_OR_GREATER + extension (ArgumentOutOfRangeException) + { + /// Throws an if is negative. + /// The argument to validate as non-negative. + /// The name of the parameter with which corresponds. + public static void ThrowIfNegative(int value, [CallerArgumentExpression("value")] string? paramName = null) + { + if (value < 0) + throw new ArgumentOutOfRangeException(paramName, "The value must not be negative."); + } + + /// Throws an if is negative. + /// The argument to validate as non-negative. + /// The name of the parameter with which corresponds. + public static void ThrowIfNegative(long value, [CallerArgumentExpression("value")] string? paramName = null) + { + if (value < 0L) + throw new ArgumentOutOfRangeException(paramName, "The value must not be negative."); + } + + /// Throws an if is greater than . + /// The argument to validate as less or equal than . + /// The value to compare with . + /// The name of the parameter with which corresponds. + public static void ThrowIfGreaterThan(T value, T other, [CallerArgumentExpression(nameof(value))] string? paramName = null) + where T : IComparable + { + if (value.CompareTo(other) > 0) + throw new ArgumentOutOfRangeException(paramName, $"The value must be less than or equal to {other}."); + } + + /// Throws an if is greater than or equal . + /// The argument to validate as less than . + /// The value to compare with . + /// The name of the parameter with which corresponds. + public static void ThrowIfGreaterThanOrEqual(T value, T other, [CallerArgumentExpression(nameof(value))] string? paramName = null) + where T : IComparable + { + if (value.CompareTo(other) >= 0) + throw new ArgumentOutOfRangeException(paramName, $"The value must be less than {other}."); + } + + /// Throws an if is less than or equal . + /// The argument to validate as greater than than . + /// The value to compare with . + /// The name of the parameter with which corresponds. + public static void ThrowIfLessThanOrEqual(T value, T other, [CallerArgumentExpression(nameof(value))] string? paramName = null) + where T : IComparable + { + if (value.CompareTo(other) <= 0) + throw new ArgumentOutOfRangeException(paramName, $"The value must be greater than {other}."); + } + } +#endif } diff --git a/src/MySqlConnector/MySqlCommand.cs b/src/MySqlConnector/MySqlCommand.cs index ff8f127e1..98d5797ca 100644 --- a/src/MySqlConnector/MySqlCommand.cs +++ b/src/MySqlConnector/MySqlCommand.cs @@ -230,12 +230,7 @@ public override int CommandTimeout get => Math.Min(m_commandTimeout ?? Connection?.DefaultCommandTimeout ?? 0, int.MaxValue / 1000); set { -#if NET8_0_OR_GREATER ArgumentOutOfRangeException.ThrowIfNegative(value); -#else - if (value < 0) - throw new ArgumentOutOfRangeException(nameof(value), "CommandTimeout must be greater than or equal to zero."); -#endif m_commandTimeout = value; ((ICancellableCommand) this).EffectiveCommandTimeout = null; } diff --git a/src/MySqlConnector/Protocol/Serialization/ByteArrayReader.cs b/src/MySqlConnector/Protocol/Serialization/ByteArrayReader.cs index 080cb8555..f5145165e 100644 --- a/src/MySqlConnector/Protocol/Serialization/ByteArrayReader.cs +++ b/src/MySqlConnector/Protocol/Serialization/ByteArrayReader.cs @@ -16,13 +16,8 @@ public int Offset readonly get => m_offset; set { -#if NET8_0_OR_GREATER ArgumentOutOfRangeException.ThrowIfNegative(value); ArgumentOutOfRangeException.ThrowIfGreaterThan(value, m_maxOffset); -#else - if (value < 0 || value > m_maxOffset) - throw new ArgumentOutOfRangeException(nameof(value), $"value must be between 0 and {m_maxOffset:d}"); -#endif m_offset = value; } } @@ -73,13 +68,8 @@ public uint ReadUInt32() public uint ReadFixedLengthUInt32(int length) { -#if NET8_0_OR_GREATER ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(length, 0); ArgumentOutOfRangeException.ThrowIfGreaterThan(length, 4); -#else - if (length is <= 0 or > 4) - throw new ArgumentOutOfRangeException(nameof(length)); -#endif VerifyRead(length); uint result = 0; for (var i = 0; i < length; i++) @@ -90,13 +80,8 @@ public uint ReadFixedLengthUInt32(int length) public ulong ReadFixedLengthUInt64(int length) { -#if NET8_0_OR_GREATER ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(length, 0); ArgumentOutOfRangeException.ThrowIfGreaterThan(length, 8); -#else - if (length is <= 0 or > 8) - throw new ArgumentOutOfRangeException(nameof(length)); -#endif VerifyRead(length); ulong result = 0; for (var i = 0; i < length; i++) diff --git a/src/MySqlConnector/Utilities/TimerQueue.cs b/src/MySqlConnector/Utilities/TimerQueue.cs index 3b120264e..372dde293 100644 --- a/src/MySqlConnector/Utilities/TimerQueue.cs +++ b/src/MySqlConnector/Utilities/TimerQueue.cs @@ -14,12 +14,7 @@ internal sealed class TimerQueue /// A timer ID that can be passed to to cancel the timer. public uint Add(int delay, Action action) { -#if NET8_0_OR_GREATER ArgumentOutOfRangeException.ThrowIfNegative(delay); -#else - if (delay < 0) - throw new ArgumentOutOfRangeException(nameof(delay), $"delay must not be negative: {delay}"); -#endif var current = Environment.TickCount; lock (m_lock)