diff --git a/lib/netstd/Benchmarks/Thrift.Benchmarks/CompactProtocolBenchmarks.cs b/lib/netstd/Benchmarks/Thrift.Benchmarks/CompactProtocolBenchmarks.cs
index 16dcc76..ae4d545 100644
--- a/lib/netstd/Benchmarks/Thrift.Benchmarks/CompactProtocolBenchmarks.cs
+++ b/lib/netstd/Benchmarks/Thrift.Benchmarks/CompactProtocolBenchmarks.cs
@@ -28,8 +28,8 @@
     [MemoryDiagnoser]
     public class CompactProtocolBenchmarks
     {
-        private MemoryStream _Stream;
-        private TProtocol _Protocol;
+        private MemoryStream? _Stream;
+        private TProtocol? _Protocol;
 
         [Params(10000)]
         public int NumberOfOperationsPerIteration { get; set; }
@@ -45,16 +45,18 @@
         [GlobalCleanup]
         public void GlobalCleanup()
         {
-            _Protocol.Dispose();
+            _Protocol?.Dispose();
         }
 
         [Benchmark]
         public async Task WriteString()
         {
+            if ((_Protocol is null) || (_Stream is null))
+                throw new System.Exception("unexpected internal state");
+
             for (int i = 0; i < NumberOfOperationsPerIteration; i++)
             {
                 await _Protocol.WriteStringAsync("Thrift String Benchmark");
-
                 _Stream.Seek(0, SeekOrigin.Begin);
             }
         }
@@ -62,12 +64,14 @@
         [Benchmark]
         public async Task ReadString()
         {
+            if ((_Protocol is null) || (_Stream is null))
+                throw new System.Exception("unexpected internal state");
+
             await _Protocol.WriteStringAsync("Thrift String Benchmark");
 
             for (int i = 0; i < NumberOfOperationsPerIteration; i++)
             {
                 _Stream.Seek(0, SeekOrigin.Begin);
-
                 await _Protocol.ReadStringAsync();
             }
         }
diff --git a/lib/netstd/Benchmarks/Thrift.Benchmarks/Thrift.Benchmarks.csproj b/lib/netstd/Benchmarks/Thrift.Benchmarks/Thrift.Benchmarks.csproj
index 633850e..0e29b3b 100644
--- a/lib/netstd/Benchmarks/Thrift.Benchmarks/Thrift.Benchmarks.csproj
+++ b/lib/netstd/Benchmarks/Thrift.Benchmarks/Thrift.Benchmarks.csproj
@@ -23,6 +23,7 @@
     <TargetFramework>net6.0</TargetFramework>
     <TieredCompilation>false</TieredCompilation>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Nullable>enable</Nullable>
   </PropertyGroup>
 
   <ItemGroup>
diff --git a/lib/netstd/Tests/Thrift.IntegrationTests/Protocols/ProtocolsOperationsTests.cs b/lib/netstd/Tests/Thrift.IntegrationTests/Protocols/ProtocolsOperationsTests.cs
index 62ab317..dd9646a 100644
--- a/lib/netstd/Tests/Thrift.IntegrationTests/Protocols/ProtocolsOperationsTests.cs
+++ b/lib/netstd/Tests/Thrift.IntegrationTests/Protocols/ProtocolsOperationsTests.cs
@@ -25,13 +25,15 @@
 using Thrift.Protocol.Entities;
 using Thrift.Transport.Client;
 
+#pragma warning disable IDE0063  // using
+
 namespace Thrift.IntegrationTests.Protocols
 {
     [TestClass]
     public class ProtocolsOperationsTests
     {
-        private readonly CompareLogic _compareLogic = new CompareLogic();
-        private static readonly TConfiguration Configuration = null;  // or new TConfiguration() if needed
+        private readonly CompareLogic _compareLogic = new();
+        private static readonly TConfiguration Configuration = new();
 
         [DataTestMethod]
         [DataRow(typeof(TBinaryProtocol), TMessageType.Call)]
@@ -496,8 +498,9 @@
         {
             var memoryStream = new MemoryStream();
             var streamClientTransport = new TStreamTransport(memoryStream, memoryStream,Configuration);
-            var protocol = (TProtocol) Activator.CreateInstance(protocolType, streamClientTransport);
-            return new Tuple<Stream, TProtocol>(memoryStream, protocol);
+            if( Activator.CreateInstance(protocolType, streamClientTransport) is TProtocol protocol)
+                return new Tuple<Stream, TProtocol>(memoryStream, protocol);
+            throw new Exception("Unexpected");
         }
     }
 }
diff --git a/lib/netstd/Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj b/lib/netstd/Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj
index 6d473e4..56123dd 100644
--- a/lib/netstd/Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj
+++ b/lib/netstd/Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj
@@ -30,6 +30,7 @@
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
     <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
+    <Nullable>enable</Nullable>
   </PropertyGroup>
 
   <ItemGroup>
diff --git a/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.Tests.csproj b/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.Tests.csproj
index 1511274..0d2770d 100644
--- a/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.Tests.csproj
+++ b/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.Tests.csproj
@@ -29,6 +29,7 @@
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
     <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
+    <Nullable>enable</Nullable>
   </PropertyGroup>
 
   <ItemGroup>
diff --git a/lib/netstd/Tests/Thrift.Tests/Collections/TCollectionsTests.cs b/lib/netstd/Tests/Thrift.Tests/Collections/TCollectionsTests.cs
index 061032a..778d24c 100644
--- a/lib/netstd/Tests/Thrift.Tests/Collections/TCollectionsTests.cs
+++ b/lib/netstd/Tests/Thrift.Tests/Collections/TCollectionsTests.cs
@@ -216,9 +216,9 @@
             public int X { get; set; }
 
             // all Thrift-generated classes override Equals(), we do just the same
-            public override bool Equals(object that)
+            public override bool Equals(object? that)
             {
-                if (!(that is ExampleClass other)) return false;
+                if (that is not ExampleClass other) return false;
                 if (ReferenceEquals(this, other)) return true;
 
                 return this.X == other.X;
diff --git a/lib/netstd/Tests/Thrift.Tests/DataModel/DeepCopy.cs b/lib/netstd/Tests/Thrift.Tests/DataModel/DeepCopy.cs
index f717b4d..84fcab8 100644
--- a/lib/netstd/Tests/Thrift.Tests/DataModel/DeepCopy.cs
+++ b/lib/netstd/Tests/Thrift.Tests/DataModel/DeepCopy.cs
@@ -24,6 +24,8 @@
 using OptReqDefTest;
 using Thrift.Collections;
 
+#nullable disable  // this is just test code, we leave it at that
+
 namespace Thrift.Tests.DataModel
 {
     // ReSharper disable once InconsistentNaming
@@ -289,7 +291,7 @@
             return value;
         }
 
-        private List<Dictionary<sbyte, THashSet<Distance>>> ModifyValue(List<Dictionary<sbyte, THashSet<Distance>>> value)
+        private static List<Dictionary<sbyte, THashSet<Distance>>> ModifyValue(List<Dictionary<sbyte, THashSet<Distance>>> value)
         {
             if (value == null)
                 value = new List<Dictionary<sbyte, THashSet<Distance>>>();
@@ -325,7 +327,7 @@
             return value;
         }
 
-        private THashSet<List<Distance>> ModifyValue(THashSet<List<Distance>> value)
+        private static THashSet<List<Distance>> ModifyValue(THashSet<List<Distance>> value)
         {
             if (value == null)
                 value = new THashSet<List<Distance>>();
@@ -342,7 +344,7 @@
             return value;
         }
 
-        private Dictionary<Distance, Distance> ModifyValue(Dictionary<Distance, Distance> value)
+        private static Dictionary<Distance, Distance> ModifyValue(Dictionary<Distance, Distance> value)
         {
             if (value == null)
                 value = new Dictionary<Distance, Distance>();
@@ -352,7 +354,7 @@
             return value;
         }
 
-        private THashSet<Distance> ModifyValue(THashSet<Distance> value)
+        private static THashSet<Distance> ModifyValue(THashSet<Distance> value)
         {
             if (value == null)
                 value = new THashSet<Distance>();
@@ -375,7 +377,7 @@
             return value;
         }
 
-        private List<Distance> ModifyValue(List<Distance> value)
+        private static List<Distance> ModifyValue(List<Distance> value)
         {
             if (value == null)
                 value = new List<Distance>();
@@ -385,12 +387,12 @@
             return value;
         }
 
-        private bool ModifyValue(bool value)
+        private static bool ModifyValue(bool value)
         {
             return !value;
         }
 
-        private Dictionary<sbyte, short> ModifyValue(Dictionary<sbyte, short> value)
+        private static Dictionary<sbyte, short> ModifyValue(Dictionary<sbyte, short> value)
         {
             if (value == null)
                 value = new Dictionary<sbyte, short>();
@@ -398,7 +400,7 @@
             return value;
         }
 
-        private THashSet<long> ModifyValue(THashSet<long> value)
+        private static THashSet<long> ModifyValue(THashSet<long> value)
         {
             if (value == null)
                 value = new THashSet<long>();
@@ -406,7 +408,7 @@
             return value;
         }
 
-        private List<int> ModifyValue(List<int> value)
+        private static List<int> ModifyValue(List<int> value)
         {
             if (value == null)
                 value = new List<int>();
@@ -414,7 +416,7 @@
             return value;
         }
 
-        private byte[] ModifyValue(byte[] value)
+        private static byte[] ModifyValue(byte[] value)
         {
             if (value == null)
                 value = new byte[1] { 0 };
@@ -423,27 +425,27 @@
             return value;
         }
 
-        private string ModifyValue(string value)
+        private static string ModifyValue(string value)
         {
             return value + "1";
         }
 
-        private double ModifyValue(double value)
+        private static double ModifyValue(double value)
         {
             return value + 1.1;
         }
 
-        private short ModifyValue(short value)
+        private static short ModifyValue(short value)
         {
             return ++value;
         }
 
-        private Distance ModifyValue(Distance value)
+        private static Distance ModifyValue(Distance value)
         {
             return ++value;
         }
 
-        private void VerifyDifferentContent(RaceDetails first, RaceDetails second)
+        private static void VerifyDifferentContent(RaceDetails first, RaceDetails second)
         {
             Assert.AreNotEqual(first, second);
 
@@ -521,7 +523,7 @@
             Assert.AreNotEqual(first.Triplesix, second.Triplesix);
         }
 
-        private void VerifyIdenticalContent(RaceDetails first, RaceDetails second)
+        private static void VerifyIdenticalContent(RaceDetails first, RaceDetails second)
         {
             Assert.AreEqual(first, second);
 
diff --git a/lib/netstd/Tests/Thrift.Tests/Thrift.Tests.csproj b/lib/netstd/Tests/Thrift.Tests/Thrift.Tests.csproj
index 18fce01..38a6a5c 100644
--- a/lib/netstd/Tests/Thrift.Tests/Thrift.Tests.csproj
+++ b/lib/netstd/Tests/Thrift.Tests/Thrift.Tests.csproj
@@ -21,6 +21,7 @@
   <PropertyGroup>
     <TargetFramework>net6.0</TargetFramework>
     <Version>0.16.0.0</Version>
+    <Nullable>enable</Nullable>
   </PropertyGroup>
 
   <ItemGroup>
