diff --git a/.editorconfig b/.editorconfig
index a4c0e063ea..819a41fe1e 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -178,6 +178,9 @@ csharp_space_between_square_brackets = false
# Analyzers
+# IDE0005: Remove unnecessary using directives
+dotnet_diagnostic.IDE0005.severity = suggestion
+
dotnet_code_quality.ca1802.api_surface = private, internal
# CA2000: Dispose objects before losing scope
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 1311dafa09..ac0be63e88 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -50,37 +50,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
-
-
@@ -102,7 +82,7 @@
-
+
@@ -111,21 +91,21 @@
-
-
+
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
@@ -138,6 +118,7 @@
-
+
+
diff --git a/doc/Directory.Packages.props b/doc/Directory.Packages.props
index 66b295ed74..2ead6c1757 100644
--- a/doc/Directory.Packages.props
+++ b/doc/Directory.Packages.props
@@ -2,8 +2,9 @@
-
-
-
+
+
+
+
diff --git a/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs b/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs
index e7f1b1716f..b9be5306ca 100644
--- a/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs
+++ b/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs
@@ -8,7 +8,9 @@ namespace AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope
//
class Program
{
+#pragma warning disable CS0649 // Field is never assigned to
private static string connectionString;
+#pragma warning restore CS0649
static void Main()
{
diff --git a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs
index c18562ee65..466137f7af 100644
--- a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs
+++ b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs
@@ -1,4 +1,4 @@
-namespace ConnectionStringSettings_RetrieveFromConfigByName;
+namespace ConnectionStringSettings_RetrieveFromConfigByName;
using System;
using System.Configuration;
diff --git a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs
index 645b30d744..881d58d658 100644
--- a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs
+++ b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs
@@ -1,4 +1,4 @@
-namespace ConnectionStringSettings_RetrieveFromConfigByProvider;
+namespace ConnectionStringSettings_RetrieveFromConfigByProvider;
using System;
using System.Data;
diff --git a/doc/samples/ConnectionStrings_Encrypt.cs b/doc/samples/ConnectionStrings_Encrypt.cs
index f94e75b520..858cd71c82 100644
--- a/doc/samples/ConnectionStrings_Encrypt.cs
+++ b/doc/samples/ConnectionStrings_Encrypt.cs
@@ -1,4 +1,4 @@
-namespace ConnectionStrings_Encrypt;
+namespace ConnectionStrings_Encrypt;
using System;
using System.Configuration;
diff --git a/doc/samples/Microsoft.Data.SqlClient.Samples.csproj b/doc/samples/Microsoft.Data.SqlClient.Samples.csproj
index e66e098c7d..c194fac4d0 100644
--- a/doc/samples/Microsoft.Data.SqlClient.Samples.csproj
+++ b/doc/samples/Microsoft.Data.SqlClient.Samples.csproj
@@ -4,11 +4,12 @@
net8.0;net462
Library
disable
- enable
+
+
Latest
False
-
+
@@ -16,6 +17,7 @@
+
@@ -26,5 +28,5 @@
-
+
diff --git a/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs b/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs
index 51352596c6..16b0f53cf1 100644
--- a/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs
+++ b/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs
@@ -1,4 +1,4 @@
-namespace SqlUserDefinedTypeAttribute_Type1;
+namespace SqlUserDefinedTypeAttribute_Type1;
//-----------------------------------------------------------------------------
//
diff --git a/doc/samples/SqlBulkCopy_RowArray.cs b/doc/samples/SqlBulkCopy_RowArray.cs
index 838f5245af..5ee0c61bdf 100644
--- a/doc/samples/SqlBulkCopy_RowArray.cs
+++ b/doc/samples/SqlBulkCopy_RowArray.cs
@@ -119,4 +119,4 @@ private static string GetConnectionString()
"Initial Catalog=AdventureWorks;";
}
}
-//
+//
diff --git a/doc/samples/SqlClientDiagnosticCounter.cs b/doc/samples/SqlClientDiagnosticCounter.cs
index 6f78fa8b22..d4b25a6acc 100644
--- a/doc/samples/SqlClientDiagnosticCounter.cs
+++ b/doc/samples/SqlClientDiagnosticCounter.cs
@@ -1,4 +1,4 @@
-namespace SqlClientDiagnosticCounter;
+namespace SqlClientDiagnosticCounter;
//
using System;
diff --git a/doc/samples/SqlClientEventSource.cs b/doc/samples/SqlClientEventSource.cs
index 532b1d88e3..81ff98ee93 100644
--- a/doc/samples/SqlClientEventSource.cs
+++ b/doc/samples/SqlClientEventSource.cs
@@ -1,4 +1,4 @@
-namespace SqlClientEventSource;
+namespace SqlClientEventSource;
//
using System;
diff --git a/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs b/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs
index 2d67007a67..2423cc306f 100644
--- a/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs
+++ b/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs
@@ -1,4 +1,5 @@
#if NETFRAMEWORK
+#nullable enable
//
using System;
@@ -24,8 +25,8 @@ public Form1()
private void InitializeComponent() { }
- // Hook up the form's Load event handler (you can double-click on
- // the form's design surface in Visual Studio), and then add
+ // Hook up the form's Load event handler (you can double-click on
+ // the form's design surface in Visual Studio), and then add
// this code to the form's class:
// You need this delegate in order to fill the grid from
// a thread other than the form's thread. See the HandleCallback
@@ -36,7 +37,7 @@ private void InitializeComponent() { }
private delegate void DisplayStatusDelegate(string Text);
// This flag ensures that the user does not attempt
- // to restart the command or close the form while the
+ // to restart the command or close the form while the
// asynchronous command is executing.
private bool isExecuting;
@@ -71,7 +72,7 @@ private void FillGrid(SqlDataReader reader)
finally
{
// Closing the reader also closes the connection,
- // because this reader was created using the
+ // because this reader was created using the
// CommandBehavior.CloseConnection value.
if (reader != null)
{
@@ -92,32 +93,32 @@ private void HandleCallback(IAsyncResult result)
// You may not interact with the form and its contents
// from a different thread, and this callback procedure
// is all but guaranteed to be running from a different thread
- // than the form. Therefore you cannot simply call code that
+ // than the form. Therefore you cannot simply call code that
// fills the grid, like this:
// FillGrid(reader);
// Instead, you must call the procedure from the form's thread.
// One simple way to accomplish this is to call the Invoke
// method of the form, which calls the delegate you supply
- // from the form's thread.
+ // from the form's thread.
FillGridDelegate del = new FillGridDelegate(FillGrid);
this.Invoke(del, reader);
- // Do not close the reader here, because it is being used in
+ // Do not close the reader here, because it is being used in
// a separate thread. Instead, have the procedure you have
// called close the reader once it is done with it.
}
catch (Exception ex)
{
- // Because you are now running code in a separate thread,
+ // Because you are now running code in a separate thread,
// if you do not handle the exception here, none of your other
- // code catches the exception. Because there is none of
+ // code catches the exception. Because there is none of
// your code on the call stack in this thread, there is nothing
- // higher up the stack to catch the exception if you do not
- // handle it here. You can either log the exception or
- // invoke a delegate (as in the non-error case in this
+ // higher up the stack to catch the exception if you do not
+ // handle it here. You can either log the exception or
+ // invoke a delegate (as in the non-error case in this
// example) to display the error on the form. In no case
// can you simply display the error without executing a delegate
- // as in the try block here.
- // You can create the delegate instance as you
+ // as in the try block here.
+ // You can create the delegate instance as you
// invoke it, like this:
this.Invoke(new DisplayStatusDelegate(DisplayStatus), "Error: " +
ex.Message);
@@ -130,8 +131,8 @@ private void HandleCallback(IAsyncResult result)
private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
return "Data Source=(local);Integrated Security=true;" +
"Initial Catalog=AdventureWorks";
@@ -153,7 +154,7 @@ private void button1_Click(object sender, System.EventArgs e)
{
DisplayStatus("Connecting...");
connection = new SqlConnection(GetConnectionString());
- // To emulate a long-running query, wait for
+ // To emulate a long-running query, wait for
// a few seconds before retrieving the real data.
command = new SqlCommand("WAITFOR DELAY '0:0:5';" +
"SELECT ProductID, Name, ListPrice, Weight FROM Production.Product",
@@ -162,8 +163,8 @@ private void button1_Click(object sender, System.EventArgs e)
DisplayStatus("Executing...");
isExecuting = true;
- // Although it is not required that you pass the
- // SqlCommand object as the second parameter in the
+ // Although it is not required that you pass the
+ // SqlCommand object as the second parameter in the
// BeginExecuteReader call, doing so makes it easier
// to call EndExecuteReader in the callback procedure.
AsyncCallback callback = new AsyncCallback(HandleCallback);
diff --git a/doc/samples/SqlDataAdapter_Events.cs b/doc/samples/SqlDataAdapter_Events.cs
index 1c8188b046..447537e0a4 100644
--- a/doc/samples/SqlDataAdapter_Events.cs
+++ b/doc/samples/SqlDataAdapter_Events.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.Data.SqlClient;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_FillDataSet.cs b/doc/samples/SqlDataAdapter_FillDataSet.cs
index 378b2d7e74..fb8c352a63 100644
--- a/doc/samples/SqlDataAdapter_FillDataSet.cs
+++ b/doc/samples/SqlDataAdapter_FillDataSet.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.Data.SqlClient;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_MergeIdentity.cs b/doc/samples/SqlDataAdapter_MergeIdentity.cs
index aa0b2b6fa5..4d66198644 100644
--- a/doc/samples/SqlDataAdapter_MergeIdentity.cs
+++ b/doc/samples/SqlDataAdapter_MergeIdentity.cs
@@ -1,4 +1,4 @@
-namespace SqlDataAdapter_MergeIdentity;
+namespace SqlDataAdapter_MergeIdentity;
using System;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_Paging.cs b/doc/samples/SqlDataAdapter_Paging.cs
index c5f7a50322..484f827a71 100644
--- a/doc/samples/SqlDataAdapter_Paging.cs
+++ b/doc/samples/SqlDataAdapter_Paging.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.Data.SqlClient;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_Properties.cs b/doc/samples/SqlDataAdapter_Properties.cs
index aa59283844..ac01b1817e 100644
--- a/doc/samples/SqlDataAdapter_Properties.cs
+++ b/doc/samples/SqlDataAdapter_Properties.cs
@@ -1,4 +1,4 @@
-namespace SqlDataAdapter_Properties;
+namespace SqlDataAdapter_Properties;
//
using System;
diff --git a/doc/samples/SqlDataAdapter_RowUpdated.cs b/doc/samples/SqlDataAdapter_RowUpdated.cs
index bcd44fb46a..9fbafc94a6 100644
--- a/doc/samples/SqlDataAdapter_RowUpdated.cs
+++ b/doc/samples/SqlDataAdapter_RowUpdated.cs
@@ -11,8 +11,10 @@ namespace SqlDataAdapter_RowUpdated;
public class Form1 : Form
{
+#pragma warning disable CS0169 // Field is never used
private DataSet DataSet1;
private DataGrid dataGrid1;
+#pragma warning restore CS0169
// handler for RowUpdating event
private static void OnRowUpdating(object sender, SqlRowUpdatingEventArgs e)
diff --git a/doc/samples/SqlDataAdapter_Update.cs b/doc/samples/SqlDataAdapter_Update.cs
index 3dfad3708f..cde3f31cae 100644
--- a/doc/samples/SqlDataAdapter_Update.cs
+++ b/doc/samples/SqlDataAdapter_Update.cs
@@ -1,4 +1,4 @@
-namespace SqlDataAdapterUpdateExample;
+namespace SqlDataAdapterUpdateExample;
using System;
using System.Data;
diff --git a/doc/samples/SqlFunctionAttribute.cs b/doc/samples/SqlFunctionAttribute.cs
index 83d9db28f7..c88697b0a9 100644
--- a/doc/samples/SqlFunctionAttribute.cs
+++ b/doc/samples/SqlFunctionAttribute.cs
@@ -24,4 +24,4 @@ public static IEnumerable GetFileDetails(string directoryPath)
}
}
-//
+//
diff --git a/doc/samples/SqlParameterCollection_AddWithValue.cs b/doc/samples/SqlParameterCollection_AddWithValue.cs
index 645125bae2..46a78cf77e 100644
--- a/doc/samples/SqlParameterCollection_AddWithValue.cs
+++ b/doc/samples/SqlParameterCollection_AddWithValue.cs
@@ -46,7 +46,6 @@ private static void UpdateDemographics(Int32 customerID,
}
}
}
- //
static private string GetConnectionString()
{
// To avoid storing the connection string in your code,
diff --git a/doc/samples/SqlRowUpdatingEventArgs.cs b/doc/samples/SqlRowUpdatingEventArgs.cs
index f0d533631a..9279ac348c 100644
--- a/doc/samples/SqlRowUpdatingEventArgs.cs
+++ b/doc/samples/SqlRowUpdatingEventArgs.cs
@@ -11,8 +11,10 @@ namespace SqlRowUpdatingEventArgsCS;
public class Form1 : Form
{
+#pragma warning disable CS0169 // Field is never used
private DataSet DataSet1;
private DataGrid dataGrid1;
+#pragma warning restore CS0169
// handler for RowUpdating event
diff --git a/doc/samples/SspiContextProvider_CustomProvider.cs b/doc/samples/SspiContextProvider_CustomProvider.cs
index 1cacd414ea..1c024ffdb6 100644
--- a/doc/samples/SspiContextProvider_CustomProvider.cs
+++ b/doc/samples/SspiContextProvider_CustomProvider.cs
@@ -1,4 +1,7 @@
+#if NET
//
+#nullable enable
+
using System;
using System.Buffers;
using System.Net.Security;
@@ -53,3 +56,4 @@ static void Main()
}
}
//
+#endif
diff --git a/doc/samples/TransactionIsolationLevels.cs b/doc/samples/TransactionIsolationLevels.cs
index 818a3086a5..985d9c2ad2 100644
--- a/doc/samples/TransactionIsolationLevels.cs
+++ b/doc/samples/TransactionIsolationLevels.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Data;
//
using Microsoft.Data.SqlClient;
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Directory.Packages.props b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Directory.Packages.props
new file mode 100644
index 0000000000..4145484108
--- /dev/null
+++ b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Directory.Packages.props
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Directory.Packages.props b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Directory.Packages.props
new file mode 100644
index 0000000000..4145484108
--- /dev/null
+++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Directory.Packages.props
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln
index a82d9f616c..a676900ad0 100644
--- a/src/Microsoft.Data.SqlClient.sln
+++ b/src/Microsoft.Data.SqlClient.sln
@@ -328,7 +328,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlClient.Stress.Runner", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlClient.Stress.Tests", "Microsoft.Data.SqlClient\tests\StressTests\SqlClient.Stress.Tests\SqlClient.Stress.Tests.csproj", "{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Data.SqlClient.Samples", "..\doc\Samples\Microsoft.Data.SqlClient.Samples.csproj", "{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Data.SqlClient.Samples", "..\doc\samples\Microsoft.Data.SqlClient.Samples.csproj", "{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Data.SqlClient.TestCommon", "Microsoft.Data.SqlClient\tests\Common\Microsoft.Data.SqlClient.TestCommon.csproj", "{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}"
EndProject
@@ -700,11 +700,17 @@ Global
{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}.Release|x86.ActiveCfg = Release|Any CPU
{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}.Release|x86.Build.0 = Release|Any CPU
{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x64.ActiveCfg = Debug|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x64.Build.0 = Debug|x64
{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x86.ActiveCfg = Debug|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x86.Build.0 = Debug|x86
{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|Any CPU.Build.0 = Release|Any CPU
{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x64.ActiveCfg = Release|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x64.Build.0 = Release|x64
{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x86.ActiveCfg = Release|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x86.Build.0 = Release|x86
{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj
index 7d70902c4a..929db3ae5b 100644
--- a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj
+++ b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj
@@ -32,8 +32,10 @@
- $(Artifacts)/obj/$(Configuration)/$(AssemblyName)
- $(Artifacts)/bin/$(Configuration)/$(AssemblyName)
+
+ $(Artifacts)/obj/$(Configuration)/AzureKeyVaultProvider
+ $(Artifacts)/bin/$(Configuration)/AzureKeyVaultProvider
true
diff --git a/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj b/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj
index eab4f0493c..562c60b3af 100644
--- a/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj
+++ b/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj
@@ -27,9 +27,6 @@
-
diff --git a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
index e8d684f944..78ea36f1fa 100644
--- a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
+++ b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
@@ -1,17 +1,24 @@
-
+
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/ManagedIdentityProvider.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/ManagedIdentityProvider.cs
index 0e590be0f9..baafec4205 100644
--- a/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/ManagedIdentityProvider.cs
+++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/ManagedIdentityProvider.cs
@@ -49,7 +49,8 @@ public override async Task AcquireTokenAsync(
TokenRequestContext context = new([scope]);
- TokenCredentialOptions options = new()
+ ManagedIdentityCredentialOptions options = new(
+ ManagedIdentityId.FromUserAssignedClientId(parameters.UserId))
{
AuthorityHost = new Uri(parameters.Authority)
};
@@ -58,7 +59,7 @@ public override async Task AcquireTokenAsync(
ManagedIdentityCredential credential =
_credentialCache.GetOrAdd(
parameters.UserId,
- (_) => new(parameters.UserId, options));
+ (_) => new(options));
// Set up a cancellation token based on the authentication timeout,
// ignoring overflow since this is just test code.
diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj
index b0f830084a..32cb62fa86 100644
--- a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj
+++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj
@@ -408,9 +408,6 @@
-
diff --git a/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj b/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj
index 5dca2b6845..318b44a28d 100644
--- a/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj
+++ b/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj
@@ -53,9 +53,6 @@
-
diff --git a/tools/Directory.Packages.props b/tools/Directory.Packages.props
index e0f9ef7b88..ff5dc7caa9 100644
--- a/tools/Directory.Packages.props
+++ b/tools/Directory.Packages.props
@@ -6,13 +6,13 @@
-
+
-
-
+
+
-
-
+
+
diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec
index 9507357a00..346f46431f 100644
--- a/tools/specs/Microsoft.Data.SqlClient.nuspec
+++ b/tools/specs/Microsoft.Data.SqlClient.nuspec
@@ -41,16 +41,16 @@
-
-
+
+
-
+
-
-
-
+
+
+
@@ -58,23 +58,23 @@
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
@@ -82,13 +82,13 @@
-
-
+
+
-
-
+
+