diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs index 43c69919d6..d2f385d672 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs @@ -501,8 +501,8 @@ public static void ActiveDirectoryManagedIdentityWithInvalidUserIdMustFail(strin SqlException e = Assert.Throws(() => ConnectAndDisconnect(connStrWithNoCred)); - string expectedMessage = "ManagedIdentityCredential authentication unavailable"; - Assert.Contains(expectedMessage, e.GetBaseException().Message); + string expectedMessage = "[Managed Identity] Authentication unavailable"; + Assert.Contains(expectedMessage, e.GetBaseException().Message, StringComparison.OrdinalIgnoreCase); } [ConditionalFact(nameof(IsAADConnStringsSetup))] diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/DistributedTransactionTest.Windows.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/DistributedTransactionTest.Windows.cs index 5719130cf9..049ed28092 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/DistributedTransactionTest.Windows.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/DistributedTransactionTest.Windows.cs @@ -48,15 +48,15 @@ public async Task Delegated_transaction_deadlock_in_SinglePhaseCommit() private static bool s_EnlistedTransactionPreservedWhilePooledCondition => DataTestUtility.AreConnStringsSetup() && DataTestUtility.IsNotX86Architecture; [ConditionalFact(nameof(s_EnlistedTransactionPreservedWhilePooledCondition), Timeout = 10000)] - public void Test_EnlistedTransactionPreservedWhilePooled() + public async Task Test_EnlistedTransactionPreservedWhilePooled() { #if NET TransactionManager.ImplicitDistributedTransactions = true; #endif - RunTestSet(EnlistedTransactionPreservedWhilePooled); + await RunTestSet(EnlistedTransactionPreservedWhilePooled); } - private void EnlistedTransactionPreservedWhilePooled() + private async Task EnlistedTransactionPreservedWhilePooled() { Exception commandException = null; Exception transactionException = null; @@ -67,7 +67,7 @@ private void EnlistedTransactionPreservedWhilePooled() { // Leave first connection open so that the transaction is promoted SqlConnection rootConnection = new SqlConnection(ConnectionString); - rootConnection.Open(); + await rootConnection.OpenAsync(); using (SqlCommand command = rootConnection.CreateCommand()) { command.CommandText = $"INSERT INTO {TestTableName} VALUES ({InputCol1}, '{InputCol2}')"; @@ -109,25 +109,25 @@ private void EnlistedTransactionPreservedWhilePooled() } // Even if an application swallows the command exception, completing the transaction should indicate that it failed. - var expectedTransactionExceptions = new[] { typeof(TransactionAbortedException), typeof(TransactionInDoubtException) }; + Type[] expectedTransactionExceptions = new[] { typeof(TransactionAbortedException), typeof(TransactionInDoubtException) }; Assert.Contains(transactionException.GetType(), expectedTransactionExceptions); - var expectedCommandExceptions = new[] { typeof(SqlException), typeof(InvalidOperationException) }; + Type[] expectedCommandExceptions = new[] { typeof(SqlException), typeof(InvalidOperationException) }; Assert.Contains(commandException.GetType(), expectedCommandExceptions); - if (commandException is SqlException) + if (commandException is SqlException exception) { // See https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors-8000-to-8999?view=sql-server-ver16 // The distributed transaction failed // See https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors-3000-to-3999?view=sql-server-ver16 // Error 3971 corresponds to "The server failed to resume the transaction." var expectedExceptionCodes = new[] { 3971, 8525 }; - Assert.Contains(((SqlException)commandException).Number, expectedExceptionCodes); + Assert.Contains(exception.Number, expectedExceptionCodes); } // Verify that nothing made it into the database DataTable result = DataTestUtility.RunQuery(ConnectionString, $"select col2 from {TestTableName} where col1 = {InputCol1}"); - Assert.True(result.Rows.Count == 0); + Assert.Equal(0, result.Rows.Count); } private void KillProcess(int serverProcessId) @@ -152,7 +152,7 @@ private void KillProcess(int serverProcessId) private const int InputCol1 = 1; private const string InputCol2 = "One"; - private static void RunTestSet(Action TestCase) + private static async Task RunTestSet(Func TestCase) { SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(DataTestUtility.TCPConnectionString); @@ -165,7 +165,7 @@ private static void RunTestSet(Action TestCase) DataTestUtility.RunNonQuery(ConnectionString, $"create table {TestTableName} (col1 int, col2 text)"); try { - TestCase(); + await TestCase(); } finally { diff --git a/tools/props/Versions.props b/tools/props/Versions.props index 0ab7b953e2..7f8ba0871f 100644 --- a/tools/props/Versions.props +++ b/tools/props/Versions.props @@ -26,17 +26,17 @@ 6.0.2 4.5.1 4.5.5 - 6.0.0 - 6.0.10 + 8.0.0 + 8.0.5 4.3.0 - 1.11.4 + 1.13.2 8.0.0 8.0.1 - 7.5.0 - 7.5.0 + 7.7.1 + 7.7.1 4.3.0 8.0.1 @@ -48,15 +48,15 @@ - [1.38.0,2.0.0) - [4.5.0,5.0.0) + [1.44.1,2.0.0) + [4.7.0,5.0.0) 0.14.0 3.1.6 - 10.0.0-beta.24564.1 - 8.0.0-beta.24123.1 + 10.0.0-beta.25164.6 + 10.0.0-beta.25164.6 6.0.1 2.0.8 1.0.3 @@ -71,7 +71,7 @@ 5.0.0 6.0.0 6.0.0 - 2.6.3 + 2.9.2 2.5.5 diff --git a/tools/props/VersionsNet9OrLater.props b/tools/props/VersionsNet9OrLater.props index 4b9e30bd77..80fd5d7cff 100644 --- a/tools/props/VersionsNet9OrLater.props +++ b/tools/props/VersionsNet9OrLater.props @@ -7,4 +7,8 @@ 9.0.4 9.0.4 + + + 9.0.3 + diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index bacc58da35..90f05cf0e2 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -30,23 +30,23 @@ When using NuGet 3.x this package requires at least version 3.4. - + - - + + - - + + - + - - + + @@ -54,10 +54,10 @@ When using NuGet 3.x this package requires at least version 3.4. - + - - + +