THRIFT-5479 Add net 6 support
diff --git a/test/netstd/Client/Client.csproj b/test/netstd/Client/Client.csproj
index c7d5349..859297f 100644
--- a/test/netstd/Client/Client.csproj
+++ b/test/netstd/Client/Client.csproj
@@ -31,6 +31,7 @@
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
     <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
+    <Nullable>enable</Nullable>
   </PropertyGroup>
 
   <ItemGroup>
diff --git a/test/netstd/Client/Performance/PerformanceTests.cs b/test/netstd/Client/Performance/PerformanceTests.cs
index f9eb9e4..c1f00dd 100644
--- a/test/netstd/Client/Performance/PerformanceTests.cs
+++ b/test/netstd/Client/Performance/PerformanceTests.cs
@@ -34,10 +34,10 @@
 {
     public class PerformanceTests
     {
-        private CancellationTokenSource Cancel;
-        private CrazyNesting Testdata;
-        private TMemoryBufferTransport MemBuffer;
-        private TTransport Transport;
+        private CancellationTokenSource Cancel = new();
+        private CrazyNesting? Testdata;
+        private TMemoryBufferTransport? MemBuffer;
+        private TTransport? Transport;
         private LayeredChoice Layered;
         private readonly TConfiguration Configuration = new();
 
@@ -76,52 +76,49 @@
             }
         }
 
-        private Task<TProtocol> GenericProtocolFactory<T>(bool forWrite)
+        private async Task<TProtocol> GenericProtocolFactory<T>(bool forWrite)
             where T : TProtocol
         {
             var oldTrans = Transport;
             try
             {
+                Transport = null;
+
                 // read happens after write here, so let's take over the written bytes
                 if (forWrite)
                     MemBuffer = new TMemoryBufferTransport(Configuration);  
                 else
-                    MemBuffer = new TMemoryBufferTransport(MemBuffer.GetBuffer(), Configuration);
+                    MemBuffer = new TMemoryBufferTransport(MemBuffer?.GetBuffer(), Configuration);
 
                 //  layered transports anyone?
-                switch (Layered)
+                Transport = Layered switch
                 {
-                    case LayeredChoice.None:
-                        Transport = MemBuffer;
-                        break;
-                    case LayeredChoice.Framed:
-                        Transport = new TFramedTransport(MemBuffer);
-                        break;
-                    case LayeredChoice.Buffered:
-                        Transport = new TBufferedTransport(MemBuffer);
-                        break;
-                    default:
-                        Debug.Assert(false);
-                        break;
-                }
+                    LayeredChoice.None => MemBuffer,
+                    LayeredChoice.Framed => new TFramedTransport(MemBuffer),
+                    LayeredChoice.Buffered => new TBufferedTransport(MemBuffer),
+                    _ => throw new Exception("Unhandled case " + Layered.ToString()),
+                };
+                ;
 
                 if (!Transport.IsOpen)
                     Transport.OpenAsync().Wait();
 
-                var instance = (T)Activator.CreateInstance(typeof(T), Transport);
-                return Task.FromResult<TProtocol>(instance);
+                if (Activator.CreateInstance(typeof(T), Transport) is T instance)
+                    return instance;
+
+                throw new Exception("Unexpected.");
             }
             finally
             {
-                if (oldTrans is IDisposable)
-                    (oldTrans as IDisposable).Dispose();
+                oldTrans?.Dispose();
             }
         }
 
         private string GetProtocolTransportName(TProtocol proto)
         {
-            var name = Transport.GetType().Name;
-            if (name.Equals(MemBuffer.GetType().Name))
+            var name = Transport?.GetType().Name;
+            var bufnm = MemBuffer?.GetType().Name;
+            if ((name is null) || name.Equals(bufnm))
                 name = string.Empty;
             else
                 name = " + " + name;
@@ -135,6 +132,9 @@
         {
             var stop = new Stopwatch();
 
+            if ((Testdata is null) || (Transport is null))
+                throw new Exception("unexpected internal state");
+
             var proto = await factory(true);
             stop.Start();
             await Testdata.WriteAsync(proto, Cancel.Token);
diff --git a/test/netstd/Client/Performance/TestDataFactory.cs b/test/netstd/Client/Performance/TestDataFactory.cs
index 9896285..833947c 100644
--- a/test/netstd/Client/Performance/TestDataFactory.cs
+++ b/test/netstd/Client/Performance/TestDataFactory.cs
@@ -26,7 +26,7 @@
     
     static class TestDataFactory
     {
-        public static CrazyNesting CreateCrazyNesting(int count = 10)
+        public static CrazyNesting? CreateCrazyNesting(int count = 10)
         {
             if (count <= 0)
                 return null;
@@ -78,13 +78,15 @@
 
         private static Dictionary<Numberz, long> CreateUserMap(int count)
         {
-            var retval = new Dictionary<Numberz, long>();
-            retval.Add(Numberz.ONE, count);
-            retval.Add(Numberz.TWO, count);
-            retval.Add(Numberz.THREE, count);
-            retval.Add(Numberz.FIVE, count);
-            retval.Add(Numberz.SIX, count);
-            retval.Add(Numberz.EIGHT, count);
+            var retval = new Dictionary<Numberz, long>
+            {
+                { Numberz.ONE, count },
+                { Numberz.TWO, count },
+                { Numberz.THREE, count },
+                { Numberz.FIVE, count },
+                { Numberz.SIX, count },
+                { Numberz.EIGHT, count }
+            };
             return retval;
         }
 
@@ -138,9 +140,10 @@
 
         private static Dictionary<Insanity, string> CreateListFieldDataDictValueListDict(int count)
         {
-            var retval = new Dictionary<Insanity, string>();
-            retval.Add(CreateInsanity(count), string.Format("data level {0}", count));
-            return retval;
+            return new Dictionary<Insanity, string>
+            {
+                { CreateInsanity(count), string.Format("data level {0}", count) }
+            };
         }
 
         private static byte[] CreateBytesArray(int count)
diff --git a/test/netstd/Client/TestClient.cs b/test/netstd/Client/TestClient.cs
index 38bccf1..0a7fa00 100644
--- a/test/netstd/Client/TestClient.cs
+++ b/test/netstd/Client/TestClient.cs
@@ -71,12 +71,12 @@
             public string host = "localhost";
             public int port = 9090;
             public int numThreads = 1;
-            public string url;
-            public string pipe;
+            public string url = string.Empty;
+            public string pipe = string.Empty;
             public LayeredChoice layered = LayeredChoice.None;
             public ProtocolChoice protocol = ProtocolChoice.Binary;
             public TransportChoice transport = TransportChoice.Socket;
-            private readonly TConfiguration Configuration = null;  // or new TConfiguration() if needed
+            private readonly TConfiguration Configuration = new();
 
             internal void Parse(List<string> args)
             {
@@ -210,7 +210,7 @@
                     "keys/",
                 };
 
-                string existingPath = null;
+                var existingPath = string.Empty;
                 foreach (var possiblePath in possiblePaths)
                 {
                     var path = Path.GetFullPath(possiblePath + clientCertName);
@@ -234,8 +234,7 @@
             public TTransport CreateTransport()
             {
                 // endpoint transport
-                TTransport trans = null;
-
+                TTransport trans;
                 switch (transport)
                 {
                     case TransportChoice.Http:
diff --git a/test/netstd/Server/Server.csproj b/test/netstd/Server/Server.csproj
index 7d5eb17..cda1dff 100644
--- a/test/netstd/Server/Server.csproj
+++ b/test/netstd/Server/Server.csproj
@@ -31,6 +31,7 @@
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
     <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
+    <Nullable>enable</Nullable>
   </PropertyGroup>
 
   <ItemGroup>
diff --git a/test/netstd/Server/TestServer.cs b/test/netstd/Server/TestServer.cs
index 65458d6..515a299 100644
--- a/test/netstd/Server/TestServer.cs
+++ b/test/netstd/Server/TestServer.cs
@@ -36,6 +36,7 @@
 
 #pragma warning disable IDE0063  // using can be simplified, we don't
 #pragma warning disable IDE0057  // substr can be simplified, we don't
+#pragma warning disable CS1998   // await missing
 
 namespace ThriftTest
 {
@@ -74,7 +75,7 @@
         internal TransportChoice transport = TransportChoice.Socket;
         internal ServerChoice server = ServerChoice.Simple;
         internal int port = 9090;
-        internal string pipe = null;
+        internal string pipe = string.Empty;
 
         internal void Parse(List<string> args)
         {
@@ -166,7 +167,7 @@
         public static int _clientID = -1;  // use with Interlocked only!
         #pragma warning restore CA2211
 
-        private static readonly TConfiguration Configuration = null;  // or new TConfiguration() if needed
+        private static readonly TConfiguration Configuration = new(); 
 
         public delegate void TestLogDelegate(string msg, params object[] values);
 
@@ -180,10 +181,10 @@
                 return Task.CompletedTask;
             }
 
-            public Task<object> CreateContextAsync(TProtocol input, TProtocol output, CancellationToken cancellationToken)
+            public async Task<object?> CreateContextAsync(TProtocol input, TProtocol output, CancellationToken cancellationToken)
             {
                 callCount++;
-                return Task.FromResult<object>(null);
+                return null;
             }
 
             public Task DeleteContextAsync(object serverContext, TProtocol input, TProtocol output, CancellationToken cancellationToken)
@@ -201,7 +202,7 @@
 
         public class TestHandlerAsync : ThriftTest.IAsync
         {
-            public TServer Server { get; set; }
+            //public TServer Server { get; set; }
             private readonly int handlerID;
             private readonly StringBuilder sb = new();
             private readonly TestLogDelegate logger;
@@ -520,7 +521,7 @@
                 "keys/",
             };
                         
-            string existingPath = null;
+            var existingPath = string.Empty;
             foreach (var possiblePath in possiblePaths)
             {
                 var path = Path.GetFullPath(possiblePath + serverCertName);
@@ -595,7 +596,7 @@
                     }
 
                     // Layered transport (mandatory)
-                    TTransportFactory transFactory = null;
+                    TTransportFactory? transFactory;
                     switch (param.buffering)
                     {
                         case BufferChoice.Framed: