From 565d7299171a0f8e4421a4db606307576b19f77f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?=
<1175054+carlossanlop@users.noreply.github.com>
Date: Fri, 11 Oct 2024 13:19:57 -0700
Subject: [PATCH 01/12] Bump dependency versions of packages that now ship out
of maintenance-packages (preview)
- Microsoft.Bcl.HashCode
- System.Buffers
- System.Memory
- System.Threading.Tasks.Extensions
- System.Runtime.CompilerServices.Unsafe
---
eng/Versions.props | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index 9c0d9954d8294..c25c3eda0e79c 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -111,10 +111,10 @@
10.0.0-alpha.1.24527.3
6.0.0
- 1.1.1
+ 6.0.0-preview.1.24511.1
5.0.0
1.2.0-beta.507
- 4.5.1
+ 4.6.0-preview.1.24511.1
5.0.0
4.8.6
8.0.0
@@ -131,7 +131,7 @@
10.0.0-alpha.1.24527.3
6.0.0
7.0.0
- 4.5.4
+ 4.6.0-preview.1.24511.1
4.5.0
10.0.0-alpha.1.24527.3
From 6a138fac0ed76a179fe31eb11af4909e2f750ff4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?=
<1175054+carlossanlop@users.noreply.github.com>
Date: Thu, 17 Oct 2024 16:19:23 -0700
Subject: [PATCH 02/12] Bump to latest with CLSCompliant fix.
---
eng/Versions.props | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index c25c3eda0e79c..7e6dc8adbfe5b 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -111,10 +111,10 @@
10.0.0-alpha.1.24527.3
6.0.0
- 6.0.0-preview.1.24511.1
+ 6.0.0-preview.1.24517.1
5.0.0
1.2.0-beta.507
- 4.6.0-preview.1.24511.1
+ 4.6.0-preview.1.24517.1
5.0.0
4.8.6
8.0.0
@@ -131,7 +131,7 @@
10.0.0-alpha.1.24527.3
6.0.0
7.0.0
- 4.6.0-preview.1.24511.1
+ 4.6.0-preview.1.24517.1
4.5.0
10.0.0-alpha.1.24527.3
From 5089cec3346e9792c47037b82b3cc8b0bc15bcc2 Mon Sep 17 00:00:00 2001
From: Eric StJohn
Date: Fri, 18 Oct 2024 18:21:15 -0700
Subject: [PATCH 03/12] Workaround name conflict for MathF
See https://github.com/dotnet/roslyn/issues/71442 We refer to MathF from
a comment which hits this bug problem in Roslyn where it thinks it's
ambiguous because visibility is not considered when resolving cref's in
doc comments.
---
.../src/System.Numerics.Tensors.csproj | 4 +++-
.../netstandard/TensorPrimitives.Single.netstandard.cs | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj
index 454a1ce98fbe3..838785aff5d5b 100644
--- a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj
+++ b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj
@@ -1,5 +1,5 @@
-
+
$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)
true
@@ -146,6 +146,8 @@
+
+
diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netstandard/TensorPrimitives.Single.netstandard.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netstandard/TensorPrimitives.Single.netstandard.cs
index 563080bf742c2..99496107a6e04 100644
--- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netstandard/TensorPrimitives.Single.netstandard.cs
+++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netstandard/TensorPrimitives.Single.netstandard.cs
@@ -1,6 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+extern alias Vectors;
+using Vectors::System.Numerics;
+
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
From 1905e9fb5623ea8dd98c9be7016c25e5a6c6ffde Mon Sep 17 00:00:00 2001
From: Eric StJohn
Date: Mon, 21 Oct 2024 11:03:01 -0700
Subject: [PATCH 04/12] Permit maintenance-packages prebuilts
---
eng/SourceBuildPrebuiltBaseline.xml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml
index ae969b3baa65e..ef602d2b75eb4 100644
--- a/eng/SourceBuildPrebuiltBaseline.xml
+++ b/eng/SourceBuildPrebuiltBaseline.xml
@@ -35,5 +35,13 @@
+
+
+
+
+
+
+
+
From 3ef5ad3c913d96ebdc57ddaa3735e182cdabfebe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?=
<1175054+carlossanlop@users.noreply.github.com>
Date: Wed, 30 Oct 2024 14:23:45 -0700
Subject: [PATCH 05/12] Bump versions to preview used in SBRP
---
eng/Versions.props | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index 7e6dc8adbfe5b..92b231db48d99 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -111,16 +111,16 @@
10.0.0-alpha.1.24527.3
6.0.0
- 6.0.0-preview.1.24517.1
+ 6.0.0-preview.1.24529.4
5.0.0
1.2.0-beta.507
- 4.6.0-preview.1.24517.1
+ 4.6.0-preview.1.24529.4
5.0.0
4.8.6
8.0.0
8.0.1
5.0.0
- 4.5.5
+ 4.6.0-preview.1.24529.4
10.0.0-alpha.1.24527.3
10.0.0-alpha.1.24527.3
6.0.0
@@ -129,9 +129,9 @@
5.0.0
7.0.0
10.0.0-alpha.1.24527.3
- 6.0.0
+ 6.1.0-preview.1.24529.4
7.0.0
- 4.6.0-preview.1.24517.1
+ 4.6.0-preview.1.24529.4
4.5.0
10.0.0-alpha.1.24527.3
From c8987d28b9b6e2e4f3165087a9b6263ea6856f29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?=
<1175054+carlossanlop@users.noreply.github.com>
Date: Thu, 31 Oct 2024 11:13:11 -0700
Subject: [PATCH 06/12] Add missing SystemNumericsVectorsVersion, it is only
used in the workaround for Tensors
---
eng/Versions.props | 1 +
1 file changed, 1 insertion(+)
diff --git a/eng/Versions.props b/eng/Versions.props
index 92b231db48d99..cf302f0837af6 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -148,6 +148,7 @@
10.0.0-beta.24530.1
10.0.0-beta.24530.1
10.0.0-beta.24530.1
+ 4.6.0-preview.1.24531.1
10.0.0-beta.24530.1
10.0.0-beta.24530.1
10.0.0-beta.24530.1
From 01462755cfa4487b56530e6adc1cbb0980b25efb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?=
<1175054+carlossanlop@users.noreply.github.com>
Date: Mon, 4 Nov 2024 11:37:19 -0800
Subject: [PATCH 07/12] Revert "Permit maintenance-packages prebuilts" as it is
not needed anymore after updating SBRP.
This reverts commit fe556303cf5800c2d66437ad53cdc1c6f55ad3e6.
---
eng/SourceBuildPrebuiltBaseline.xml | 8 --------
1 file changed, 8 deletions(-)
diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml
index ef602d2b75eb4..ae969b3baa65e 100644
--- a/eng/SourceBuildPrebuiltBaseline.xml
+++ b/eng/SourceBuildPrebuiltBaseline.xml
@@ -35,13 +35,5 @@
-
-
-
-
-
-
-
-
From f1f48a1791b582ae22cd70204a567e4e1fbb1ed1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?=
<1175054+carlossanlop@users.noreply.github.com>
Date: Mon, 11 Nov 2024 16:43:38 -0800
Subject: [PATCH 08/12] Bump to latest prerelease
---
eng/Versions.props | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index cf302f0837af6..87fa55b05e937 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -111,16 +111,16 @@
10.0.0-alpha.1.24527.3
6.0.0
- 6.0.0-preview.1.24529.4
+ 6.0.0-rtm.24561.10
5.0.0
1.2.0-beta.507
- 4.6.0-preview.1.24529.4
+ 4.6.0-rtm.24561.10
5.0.0
- 4.8.6
+ 4.9.0-rtm.24561.10
8.0.0
8.0.1
5.0.0
- 4.6.0-preview.1.24529.4
+ 4.6.0-rtm.24561.10
10.0.0-alpha.1.24527.3
10.0.0-alpha.1.24527.3
6.0.0
@@ -129,9 +129,9 @@
5.0.0
7.0.0
10.0.0-alpha.1.24527.3
- 6.1.0-preview.1.24529.4
+ 6.1.0-rtm.24561.10
7.0.0
- 4.6.0-preview.1.24529.4
+ 4.6.0-rtm.24561.10
4.5.0
10.0.0-alpha.1.24527.3
@@ -148,7 +148,7 @@
10.0.0-beta.24530.1
10.0.0-beta.24530.1
10.0.0-beta.24530.1
- 4.6.0-preview.1.24531.1
+ 4.6.0-rtm.24561.10
10.0.0-beta.24530.1
10.0.0-beta.24530.1
10.0.0-beta.24530.1
From f7f5c1b09874079fda4f81e08d9e106393479630 Mon Sep 17 00:00:00 2001
From: Viktor Hofer
Date: Wed, 13 Nov 2024 17:04:03 +0100
Subject: [PATCH 09/12] Update ApiCompat.proj
---
src/libraries/apicompat/ApiCompat.proj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libraries/apicompat/ApiCompat.proj b/src/libraries/apicompat/ApiCompat.proj
index 15c5b617fe509..85f3b04d7ecf6 100644
--- a/src/libraries/apicompat/ApiCompat.proj
+++ b/src/libraries/apicompat/ApiCompat.proj
@@ -43,7 +43,7 @@
-
+
From ec8185fa13d240dc36ecbff24d903d638d91368e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?=
<1175054+carlossanlop@users.noreply.github.com>
Date: Wed, 13 Nov 2024 10:51:27 -0800
Subject: [PATCH 10/12] Update to stable versions
---
eng/Versions.props | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index 87fa55b05e937..5d4a8aaf27bec 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -111,16 +111,16 @@
10.0.0-alpha.1.24527.3
6.0.0
- 6.0.0-rtm.24561.10
+ 6.0.0
5.0.0
1.2.0-beta.507
- 4.6.0-rtm.24561.10
+ 4.6.0
5.0.0
- 4.9.0-rtm.24561.10
+ 4.9.0
8.0.0
8.0.1
5.0.0
- 4.6.0-rtm.24561.10
+ 4.6.0
10.0.0-alpha.1.24527.3
10.0.0-alpha.1.24527.3
6.0.0
@@ -129,9 +129,9 @@
5.0.0
7.0.0
10.0.0-alpha.1.24527.3
- 6.1.0-rtm.24561.10
+ 6.1.0
7.0.0
- 4.6.0-rtm.24561.10
+ 4.6.0
4.5.0
10.0.0-alpha.1.24527.3
@@ -148,7 +148,7 @@
10.0.0-beta.24530.1
10.0.0-beta.24530.1
10.0.0-beta.24530.1
- 4.6.0-rtm.24561.10
+ 4.6.0
10.0.0-beta.24530.1
10.0.0-beta.24530.1
10.0.0-beta.24530.1
From f362c9ebe060f476dd2135bd7b8f773378a300b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?=
<1175054+carlossanlop@users.noreply.github.com>
Date: Tue, 19 Nov 2024 10:30:58 -0800
Subject: [PATCH 11/12] Add CS0618 to System.Data.Common.Tests.csproj NoWarn
list - 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient
package instead.
---
.../System.Data.Common/tests/System.Data.Common.Tests.csproj | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj b/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj
index dd1046a757ce3..d4a97c1b94d11 100644
--- a/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj
+++ b/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj
@@ -1,6 +1,7 @@
- $(NoWarn),0168,0169,0414,0219,0649
+
+ $(NoWarn),0168,0169,0414,0219,0649,0618
true
$(NetCoreAppCurrent)
From c57d9ee85061049b4f03313673482ba44a1a8283 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?=
<1175054+carlossanlop@users.noreply.github.com>
Date: Wed, 20 Nov 2024 14:05:23 -0800
Subject: [PATCH 12/12] Suppress CS0618 on site instead of in csproj
---
.../tests/System.Data.Common.Tests.csproj | 3 +-
.../Data/Common/DbProviderFactoriesTests.cs | 30 +++++++++++++++++++
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj b/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj
index d4a97c1b94d11..dd1046a757ce3 100644
--- a/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj
+++ b/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj
@@ -1,7 +1,6 @@
-
- $(NoWarn),0168,0169,0414,0219,0649,0618
+ $(NoWarn),0168,0169,0414,0219,0649
true
$(NetCoreAppCurrent)
diff --git a/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoriesTests.cs b/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoriesTests.cs
index b758b3967c62e..a1dd97ebe0df8 100644
--- a/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoriesTests.cs
+++ b/src/libraries/System.Data.Common/tests/System/Data/Common/DbProviderFactoriesTests.cs
@@ -41,50 +41,62 @@ public void GetFactoryNoRegistrationTest()
public void GetFactoryWithInvariantNameTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(()=>DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory)));
DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.SqlClient");
Assert.NotNull(factory);
Assert.Equal(typeof(System.Data.SqlClient.SqlClientFactory), factory.GetType());
Assert.Equal(System.Data.SqlClient.SqlClientFactory.Instance, factory);
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
public void GetFactoryWithDbConnectionTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' and 'SqlConnection' are obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(()=>DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory)));
DbProviderFactory factory = DbProviderFactories.GetFactory(new System.Data.SqlClient.SqlConnection());
Assert.NotNull(factory);
Assert.Equal(typeof(System.Data.SqlClient.SqlClientFactory), factory.GetType());
Assert.Equal(System.Data.SqlClient.SqlClientFactory.Instance, factory);
+#pragma warning restore CS0618 // 'SqlClientFactory' and 'SqlConnection' are obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
public void GetFactoryWithDataRowTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(()=> DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory)));
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
public void RegisterFactoryWithTypeNameTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(()=>DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory).AssemblyQualifiedName));
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
public void RegisterFactoryWithTypeTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(()=>DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory)));
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
public void RegisterFactoryWithInstanceTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(()=>DbProviderFactories.RegisterFactory("System.Data.SqlClient", System.Data.SqlClient.SqlClientFactory.Instance));
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
@@ -92,7 +104,9 @@ public void RegisterFactoryWithWrongTypeTest()
{
ClearRegisteredFactories();
Assert.Throws(() => DbProviderFactories.GetFactory("System.Data.SqlClient"));
+#pragma warning disable CS0618 // 'SqlConnection' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
Assert.Throws(() => DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlConnection)));
+#pragma warning restore CS0618 // 'SqlConnection' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
@@ -100,14 +114,18 @@ public void RegisterFactoryWithBadInvariantNameTest()
{
ClearRegisteredFactories();
Assert.Throws(() => DbProviderFactories.GetFactory("System.Data.SqlClient"));
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
Assert.Throws(() => DbProviderFactories.RegisterFactory(string.Empty, typeof(System.Data.SqlClient.SqlClientFactory)));
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
public void RegisterFactoryWithAssemblyQualifiedNameTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(()=>DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory).AssemblyQualifiedName));
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
@@ -118,7 +136,9 @@ public void RegisterFactoryWithWrongAssemblyQualifiedNameTest()
DataTable providerTable = DbProviderFactories.GetFactoryClasses();
Assert.Equal(0, providerTable.Rows.Count);
// register the connection type which is the wrong type. Registraton should succeed, as type registration/checking is deferred.
+#pragma warning disable CS0618 // 'SqlConnection' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlConnection).AssemblyQualifiedName);
+#pragma warning restore CS0618 // 'SqlConnection' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
providerTable = DbProviderFactories.GetFactoryClasses();
Assert.Equal(1, providerTable.Rows.Count);
// obtaining the factory will kick in the checks of the registered type name, which will cause exceptions. The checks were deferred till the GetFactory() call.
@@ -130,7 +150,9 @@ public void RegisterFactoryWithWrongAssemblyQualifiedNameTest()
public void UnregisterFactoryTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(()=>DbProviderFactories.RegisterFactory("System.Data.SqlClient", System.Data.SqlClient.SqlClientFactory.Instance));
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
Assert.True(DbProviderFactories.UnregisterFactory("System.Data.SqlClient"));
DataTable providerTable = DbProviderFactories.GetFactoryClasses();
Assert.Equal(0, providerTable.Rows.Count);
@@ -141,18 +163,22 @@ public void TryGetFactoryTest()
{
ClearRegisteredFactories();
Assert.False(DbProviderFactories.TryGetFactory("System.Data.SqlClient", out DbProviderFactory f));
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(() => DbProviderFactories.RegisterFactory("System.Data.SqlClient", System.Data.SqlClient.SqlClientFactory.Instance));
Assert.True(DbProviderFactories.TryGetFactory("System.Data.SqlClient", out DbProviderFactory factory));
Assert.NotNull(factory);
Assert.Equal(typeof(System.Data.SqlClient.SqlClientFactory), factory.GetType());
Assert.Equal(System.Data.SqlClient.SqlClientFactory.Instance, factory);
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
[Fact]
public void ReplaceFactoryWithRegisterFactoryWithTypeTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(()=>DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory)));
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(TestProviderFactory));
DataTable providerTable = DbProviderFactories.GetFactoryClasses();
Assert.Equal(1, providerTable.Rows.Count);
@@ -166,7 +192,9 @@ public void ReplaceFactoryWithRegisterFactoryWithTypeTest()
public void GetProviderInvariantNamesTest()
{
ClearRegisteredFactories();
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
RegisterSqlClientAndTestRegistration(() => DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory)));
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
DbProviderFactories.RegisterFactory("System.Data.Common.TestProvider", typeof(TestProviderFactory));
DataTable providerTable = DbProviderFactories.GetFactoryClasses();
Assert.Equal(2, providerTable.Rows.Count);
@@ -199,8 +227,10 @@ private void RegisterSqlClientAndTestRegistration(Action registrationFunc)
Assert.Equal(1, providerTable.Rows.Count);
DbProviderFactory factory = DbProviderFactories.GetFactory(providerTable.Rows[0]);
Assert.NotNull(factory);
+#pragma warning disable CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
Assert.Equal(typeof(System.Data.SqlClient.SqlClientFactory), factory.GetType());
Assert.Equal(System.Data.SqlClient.SqlClientFactory.Instance, factory);
+#pragma warning restore CS0618 // 'SqlClientFactory' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.
}
}
}