diff --git a/test/netstd/Server/Program.cs b/test/netstd/Server/Program.cs
index 8f1f36d..a319b22 100644
--- a/test/netstd/Server/Program.cs
+++ b/test/netstd/Server/Program.cs
@@ -20,12 +20,13 @@
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using ThriftTest;
+using System.Threading.Tasks;
 
 namespace Server
 {
     public class Program
     {
-        public static int Main(string[] args)
+        static async Task<int> Main(string[] args)
         {
             if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
             {
@@ -46,12 +47,12 @@
                 case "server":  // crosstest wants to pass this, so just emit a hint and ignore
                     Console.WriteLine("Hint: The 'server' argument is no longer required.");
                     argslist.RemoveAt(0);
-                    return TestServer.Execute(argslist);
+                    return await TestServer.Execute(argslist);
                 case "--help":
                     PrintHelp();
                     return 0;
                 default:
-                    return TestServer.Execute(argslist);
+                    return await TestServer.Execute(argslist);
             }
         }
 
diff --git a/test/netstd/Server/TestServer.cs b/test/netstd/Server/TestServer.cs
index 471d6c8..65458d6 100644
--- a/test/netstd/Server/TestServer.cs
+++ b/test/netstd/Server/TestServer.cs
@@ -500,13 +500,11 @@
                 return Task.FromResult(result);
             }
 
-            public Task testOneway(int secondsToSleep, CancellationToken cancellationToken)
+            public async Task testOneway(int secondsToSleep, CancellationToken cancellationToken)
             {
                 logger.Invoke("testOneway({0}), sleeping...", secondsToSleep);
-                Task.Delay(secondsToSleep * 1000, cancellationToken).GetAwaiter().GetResult();
+                await Task.Delay(secondsToSleep * 1000, cancellationToken);
                 logger.Invoke("testOneway finished");
-
-                return Task.CompletedTask;
             }
         }
 
@@ -543,7 +541,7 @@
             return cert;
         }
 
-        public static int Execute(List<string> args)
+        public static async Task<int> Execute(List<string> args)
         {
             using (var loggerFactory = new LoggerFactory()) //.AddConsole().AddDebug();
             {
@@ -648,7 +646,7 @@
                                       (param.protocol == ProtocolChoice.Compact ? " with compact protocol" : "") +
                                       (param.protocol == ProtocolChoice.Json ? " with json protocol" : "") +
                                       "...");
-                    serverEngine.ServeAsync(CancellationToken.None).GetAwaiter().GetResult();
+                    await serverEngine.ServeAsync(CancellationToken.None);
                     Console.ReadLine();
                 }
                 catch (Exception x)
