Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@ public static void ActiveDirectoryManagedIdentityWithInvalidUserIdMustFail(strin

SqlException e = Assert.Throws<SqlException>(() => 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))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}')";
Expand Down Expand Up @@ -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)
Expand All @@ -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<Task> TestCase)
{
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(DataTestUtility.TCPConnectionString);

Expand All @@ -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
{
Expand Down
20 changes: 10 additions & 10 deletions tools/props/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
<MicrosoftDataSqlClientSniVersion>6.0.2</MicrosoftDataSqlClientSniVersion>
<SystemBuffersVersion>4.5.1</SystemBuffersVersion>
<SystemMemoryVersion>4.5.5</SystemMemoryVersion>
<SystemTextEncodingsWebVersion>6.0.0</SystemTextEncodingsWebVersion>
<SystemTextJsonVersion>6.0.10</SystemTextJsonVersion>
<SystemTextEncodingsWebVersion>8.0.0</SystemTextEncodingsWebVersion>
<SystemTextJsonVersion>8.0.5</SystemTextJsonVersion>
<SystemDataCommonVersion>4.3.0</SystemDataCommonVersion>
</PropertyGroup>
<!-- NetFx and NetCore project dependencies -->
<PropertyGroup>
<AzureIdentityVersion>1.11.4</AzureIdentityVersion>
<AzureIdentityVersion>1.13.2</AzureIdentityVersion>
<MicrosoftBclCryptographyVersion>8.0.0</MicrosoftBclCryptographyVersion>
<MicrosoftExtensionsCachingMemoryVersion>8.0.1</MicrosoftExtensionsCachingMemoryVersion>
<MicrosoftIdentityModelJsonWebTokensVersion>7.5.0</MicrosoftIdentityModelJsonWebTokensVersion>
<MicrosoftIdentityModelProtocolsOpenIdConnectVersion>7.5.0</MicrosoftIdentityModelProtocolsOpenIdConnectVersion>
<MicrosoftIdentityModelJsonWebTokensVersion>7.7.1</MicrosoftIdentityModelJsonWebTokensVersion>
<MicrosoftIdentityModelProtocolsOpenIdConnectVersion>7.7.1</MicrosoftIdentityModelProtocolsOpenIdConnectVersion>
<SystemRuntimeInteropServicesRuntimeInformationVersion>4.3.0</SystemRuntimeInteropServicesRuntimeInformationVersion>
<SystemSecurityCryptographyPkcsVersion>8.0.1</SystemSecurityCryptographyPkcsVersion>
</PropertyGroup>
Expand All @@ -48,15 +48,15 @@
</PropertyGroup>
<!-- AKV Provider project dependencies -->
<PropertyGroup>
<AzureCoreVersion>[1.38.0,2.0.0)</AzureCoreVersion>
<AzureSecurityKeyVaultKeysVersion>[4.5.0,5.0.0)</AzureSecurityKeyVaultKeysVersion>
<AzureCoreVersion>[1.44.1,2.0.0)</AzureCoreVersion>
<AzureSecurityKeyVaultKeysVersion>[4.7.0,5.0.0)</AzureSecurityKeyVaultKeysVersion>
</PropertyGroup>
<!-- Test Project Dependencies -->
<PropertyGroup>
<BenchmarkDotNetVersion>0.14.0</BenchmarkDotNetVersion>
<MicrosoftDotNetPlatformAbstractionsVersion>3.1.6</MicrosoftDotNetPlatformAbstractionsVersion>
<MicrosoftDotNetRemoteExecutorVersion>10.0.0-beta.24564.1</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetXUnitExtensionsVersion>8.0.0-beta.24123.1</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetRemoteExecutorVersion>10.0.0-beta.25164.6</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetXUnitExtensionsVersion>10.0.0-beta.25164.6</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftExtensionsHosting>6.0.1</MicrosoftExtensionsHosting>
<MicrosoftNETCoreRuntimeCoreCLRVersion>2.0.8</MicrosoftNETCoreRuntimeCoreCLRVersion>
<MicrosoftNETFrameworkReferenceAssembliesVersion>1.0.3</MicrosoftNETFrameworkReferenceAssembliesVersion>
Expand All @@ -71,7 +71,7 @@
<SystemSecurityPrincipalWindowsVersion>5.0.0</SystemSecurityPrincipalWindowsVersion>
<SystemServiceProcessServiceControllerVersion>6.0.0</SystemServiceProcessServiceControllerVersion>
<SystemTextEncodingCodePagesVersion>6.0.0</SystemTextEncodingCodePagesVersion>
<XunitVersion>2.6.3</XunitVersion>
<XunitVersion>2.9.2</XunitVersion>
<XunitrunnervisualstudioVersion>2.5.5</XunitrunnervisualstudioVersion>
</PropertyGroup>
<PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions tools/props/VersionsNet9OrLater.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
<SystemSecurityCryptographyPkcsVersion>9.0.4</SystemSecurityCryptographyPkcsVersion>
<SystemConfigurationConfigurationManagerVersion>9.0.4</SystemConfigurationConfigurationManagerVersion>
</PropertyGroup>
<!-- Test Project dependencies-->
<PropertyGroup>
<MicrosoftExtensionsHosting>9.0.3</MicrosoftExtensionsHosting>
</PropertyGroup>
</Project>
22 changes: 11 additions & 11 deletions tools/specs/Microsoft.Data.SqlClient.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,34 @@ When using NuGet 3.x this package requires at least version 3.4.</description>
<dependencies>
<group targetFramework="net462">
<dependency id="Microsoft.Data.SqlClient.SNI" version="6.0.2" />
<dependency id="Azure.Identity" version="1.11.4" />
<dependency id="Azure.Identity" version="1.13.2" />
<dependency id="Microsoft.Extensions.Caching.Memory" version="8.0.1" exclude="Compile" />
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.5.0" />
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="7.5.0" />
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.7.1" />
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="7.7.1" />
<dependency id="System.Buffers" version="4.5.1" />
<dependency id="System.Text.Encodings.Web" version="6.0.0" />
<dependency id="System.Text.Json" version="6.0.10" />
<dependency id="System.Text.Encodings.Web" version="8.0.0" />
<dependency id="System.Text.Json" version="8.0.5" />
<dependency id="System.Data.Common" version="4.3.0" />
<dependency id="System.Security.Cryptography.Pkcs" version="8.0.1"/>
<dependency id="Microsoft.Bcl.Cryptography" version="8.0.0"/>
</group>
<group targetFramework="net8.0">
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="6.0.2" exclude="Compile" />
<dependency id="Azure.Identity" version="1.11.4" />
<dependency id="Azure.Identity" version="1.13.2" />
<dependency id="Microsoft.Extensions.Caching.Memory" version="8.0.1" exclude="Compile" />
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.5.0" />
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="7.5.0" />
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.7.1" />
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="7.7.1" />
<dependency id="Microsoft.SqlServer.Server" version="1.0.0"/>
<dependency id="System.Configuration.ConfigurationManager" version="8.0.1" exclude="Compile" />
<dependency id="System.Security.Cryptography.Pkcs" version="8.0.1"/>
<dependency id="Microsoft.Bcl.Cryptography" version="8.0.0"/>
</group>
<group targetFramework="net9.0">
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="6.0.2" exclude="Compile" />
<dependency id="Azure.Identity" version="1.11.4" />
<dependency id="Azure.Identity" version="1.13.2" />
<dependency id="Microsoft.Extensions.Caching.Memory" version="9.0.4" exclude="Compile" />
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.5.0" />
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="7.5.0" />
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="7.7.1" />
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="7.7.1" />
<dependency id="Microsoft.SqlServer.Server" version="1.0.0"/>
<dependency id="System.Configuration.ConfigurationManager" version="9.0.4" exclude="Compile" />
<dependency id="System.Security.Cryptography.Pkcs" version="9.0.4"/>
Expand Down
Loading