THRIFT-5832 Drop net6 support and add net9 instead
Client: netstd
Patch: Jens Geyer
diff --git a/lib/netstd/Thrift/.editorconfig b/lib/netstd/Thrift/.editorconfig
index 82ff4a3..5f43ecf 100644
--- a/lib/netstd/Thrift/.editorconfig
+++ b/lib/netstd/Thrift/.editorconfig
@@ -4,6 +4,6 @@
 dotnet_diagnostic.CS1591.severity = silent
 
 # silence certain yet unfixed false positives for net8
-dotnet_diagnostic.IDE0290.severity = silent
-dotnet_diagnostic.CA1510.severity = silent
-dotnet_diagnostic.CA1513.severity = silent
+#dotnet_diagnostic.IDE0290.severity = silent
+#dotnet_diagnostic.CA1510.severity = silent
+#dotnet_diagnostic.CA1513.severity = silent
diff --git a/lib/netstd/Thrift/GlobalSuppressions.cs b/lib/netstd/Thrift/GlobalSuppressions.cs
index eb7d3d7..cb5fc01 100644
--- a/lib/netstd/Thrift/GlobalSuppressions.cs
+++ b/lib/netstd/Thrift/GlobalSuppressions.cs
@@ -28,4 +28,7 @@
 [assembly: SuppressMessage("Style", "IDE0066", Justification = "compatibility", Scope = "module")]
 [assembly: SuppressMessage("Style", "IDE0090", Justification = "compatibility", Scope = "module")]
 [assembly: SuppressMessage("Style", "IDE0063", Justification = "compatibility", Scope = "module")]
+[assembly: SuppressMessage("Style", "IDE0130", Justification = "compatibility", Scope = "module")]
+[assembly: SuppressMessage("Style", "IDE0290", Justification = "compatibility", Scope = "module")]
+[assembly: SuppressMessage("Style", "CS0114", Justification = "known issue, see JIRA ticket", Scope = "module")]
 
diff --git a/lib/netstd/Thrift/Protocol/TJSONProtocol.cs b/lib/netstd/Thrift/Protocol/TJSONProtocol.cs
index 64308d6..02cf3ed 100644
--- a/lib/netstd/Thrift/Protocol/TJSONProtocol.cs
+++ b/lib/netstd/Thrift/Protocol/TJSONProtocol.cs
@@ -29,6 +29,8 @@
 
 #pragma warning disable IDE0079 // net20 - unneeded suppression
 #pragma warning disable IDE0290 // net8 - primary CTOR
+#pragma warning disable IDE0305 // net9 - collection init
+#pragma warning disable IDE0300 // net9 - collection init
 
 namespace Thrift.Protocol
 {
diff --git a/lib/netstd/Thrift/Thrift.csproj b/lib/netstd/Thrift/Thrift.csproj
index 8c2e6b9..9279918 100644
--- a/lib/netstd/Thrift/Thrift.csproj
+++ b/lib/netstd/Thrift/Thrift.csproj
@@ -19,7 +19,7 @@
   -->
 
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.1;netstandard2.0;net6.0;net8.0</TargetFrameworks>
+    <TargetFrameworks>netstandard2.1;netstandard2.0;net8.0;net9.0</TargetFrameworks>
     <AssemblyName>Thrift</AssemblyName>
     <PackageId>ApacheThrift</PackageId>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@@ -60,16 +60,18 @@
 
   <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" Condition="'$(TargetFramework.StartsWith(`netstandard2.`))' == 'true'" />
-    <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
-    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
-    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
-    <PackageReference Include="System.IO.Pipes" Version="[4.3,)" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
     <PackageReference Include="System.IO.Pipes.AccessControl" Version="5.0.0" Condition="'$(TargetFramework.StartsWith(`netstandard2.`))' == 'true'" />
-    <PackageReference Include="System.Net.Http.WinHttpHandler" Version="8.0.1" />
-    <PackageReference Include="System.Net.NameResolution" Version="[4.3,)" />
-    <PackageReference Include="System.Net.Requests" Version="[4.3,)" />
-    <PackageReference Include="System.Net.Security" Version="4.3.2" />
-    <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
+    <PackageReference Include="System.Net.Http.WinHttpHandler" Version="9.0.0" />
+    <!--
+    <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.0" Condition="'$(TargetFramework.StartsWith(`netstandard2.`))' == 'true'" />
+    <PackageReference Include="System.Net.Requests" Version="4.3.0" Condition="'$(TargetFramework.StartsWith(`netstandard2.`))' == 'true'" />
+    <PackageReference Include="System.Net.NameResolution" Version="4.3.0" Condition="'$(TargetFramework.StartsWith(`netstandard2.`))' == 'true'" />
+    <PackageReference Include="System.Net.Security" Version="4.3.0" Condition="'$(TargetFramework.StartsWith(`netstandard2.`))' == 'true'" />
+    <PackageReference Include="System.IO.Pipes" Version="4.3.0" Condition="'$(TargetFramework.StartsWith(`netstandard2.`))' == 'true'" />
+    -->
   </ItemGroup>
 
   <ItemGroup>
@@ -84,18 +86,18 @@
     <None Include="..\README.md" Pack="true" PackagePath="\" />
   </ItemGroup>
 
-  <ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
-    <PackageReference Include="Microsoft.AspNetCore.Components.Web">
-      <Version>7.0.9</Version>
-    </PackageReference>
-  </ItemGroup>
-	
-	<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
+  <ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
 		<PackageReference Include="Microsoft.AspNetCore.Components.Web">
-			<Version>8.0.7</Version>
+			<Version>8.0.10</Version>
 		</PackageReference>
 	</ItemGroup>
 
+  <ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
+    <PackageReference Include="Microsoft.AspNetCore.Components.Web">
+      <Version>9.0.0</Version>
+    </PackageReference>
+  </ItemGroup>
+
   <Target Name="SetTFMAssemblyAttributesPath" BeforeTargets="GenerateTargetFrameworkMonikerAttribute">
     <PropertyGroup>
       <TargetFrameworkMonikerAssemblyAttributesPath>$(IntermediateOutputPath)$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)</TargetFrameworkMonikerAssemblyAttributesPath>
diff --git a/lib/netstd/Thrift/Transport/Client/TTlsSocketTransport.cs b/lib/netstd/Thrift/Transport/Client/TTlsSocketTransport.cs
index 0a51c9a..df18124 100644
--- a/lib/netstd/Thrift/Transport/Client/TTlsSocketTransport.cs
+++ b/lib/netstd/Thrift/Transport/Client/TTlsSocketTransport.cs
@@ -82,6 +82,10 @@
             }
         }
 
+        #if NET9_0_OR_GREATER
+        [Obsolete("SYSLIB0057: X509Certificate2 and X509Certificate constructors for binary and file content are obsolete")]
+        #pragma warning disable SYSLIB0057
+        #endif
         public TTlsSocketTransport(IPAddress host, int port, TConfiguration config,
             string certificatePath,
             RemoteCertificateValidationCallback certValidator = null,
@@ -94,6 +98,7 @@
                 sslProtocols)
         {
         }
+        #pragma warning restore SYSLIB0057
 
         public TTlsSocketTransport(IPAddress host, int port, TConfiguration config,
             X509Certificate2 certificate = null,