diff --git a/lib/csharp/test/ThriftTest/Makefile.am b/lib/csharp/test/ThriftTest/Makefile.am
new file mode 100644
index 0000000..fcde6fc
--- /dev/null
+++ b/lib/csharp/test/ThriftTest/Makefile.am
@@ -0,0 +1,32 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+THRIFT = $(top_builddir)/compiler/cpp/thrift
+CSC=gmcs
+
+stubs: $(top_srcdir)/test/ThriftTest.thrift
+	$(THRIFT) --gen csharp -o . $(top_srcdir)/test/ThriftTest.thrift
+
+precross: TestClientServer.exe
+
+ThriftImpl.dll: stubs
+	$(CSC) /t:library /out:./ThriftImpl.dll /recurse:./gen-csharp/* /reference:../../Thrift.dll
+
+TestClientServer.exe: TestClient.cs TestServer.cs Program.cs ThriftImpl.dll
+	$(CSC)  /out:TestClientServer.exe /reference:../../Thrift.dll /reference:ThriftImpl.dll TestClient.cs TestServer.cs Program.cs
diff --git a/lib/csharp/test/ThriftTest/Program.cs b/lib/csharp/test/ThriftTest/Program.cs
index 3bf6796..5a4245b 100644
--- a/lib/csharp/test/ThriftTest/Program.cs
+++ b/lib/csharp/test/ThriftTest/Program.cs
@@ -31,12 +31,12 @@
 {
     class Program
     {
-        static void Main(string[] args)
+        static int Main(string[] args)
         {
             if (args.Length == 0)
             {
                 Console.WriteLine("must provide 'server' or 'client' arg");
-                return;
+                return -1;
             }
 
             string[] subArgs = new string[args.Length - 1];
@@ -46,16 +46,17 @@
             }
             if (args[0] == "client")
             {
-                TestClient.Execute(subArgs);
+                return TestClient.Execute(subArgs) ? 0 : 1;
             }
             else if (args[0] == "server")
             {
-                TestServer.Execute(subArgs);
+                return TestServer.Execute(subArgs) ? 0 : 1;
             }
             else
             {
                 Console.WriteLine("first argument must be 'server' or 'client'");
             }
+            return 0;
         }
     }
 }
diff --git a/lib/csharp/test/ThriftTest/TestClient.cs b/lib/csharp/test/ThriftTest/TestClient.cs
index a0ceb15..ec0696a 100644
--- a/lib/csharp/test/ThriftTest/TestClient.cs
+++ b/lib/csharp/test/ThriftTest/TestClient.cs
@@ -32,7 +32,7 @@
         private static int numIterations = 1;
         private static string protocol = "";
 
-        public static void Execute(string[] args)
+        public static bool Execute(string[] args)
         {
             try
             {
@@ -41,6 +41,7 @@
                 string url = null, pipe = null;
                 int numThreads = 1;
                 bool buffered = false, framed = false, encrypted = false;
+                string certPath = "../../../../../keys/server.pem";
 
                 try
                 {
@@ -96,6 +97,10 @@
                             encrypted = true;
                             Console.WriteLine("Using encrypted transport");
                         }
+                        else if (args[i].StartsWith("--cert="))
+                        {
+                            certPath = args[i].Substring("--cert=".Length);
+                        }
                     }
                 }
                 catch (Exception e)
@@ -119,7 +124,7 @@
                         else
                         {
                             if (encrypted)
-                                trans = new TTLSSocket(host, port, "../../../../../keys/client.pem");
+                                trans = new TTLSSocket(host, port, certPath);
                             else
                                 trans = new TSocket(host, port);
                         }
@@ -151,10 +156,12 @@
             catch (Exception outerEx)
             {
                 Console.WriteLine(outerEx.Message + " ST: " + outerEx.StackTrace);
+                return false;
             }
 
             Console.WriteLine();
             Console.WriteLine();
+            return true;
         }
 
         public static void ClientThread(object obj)
diff --git a/lib/csharp/test/ThriftTest/TestServer.cs b/lib/csharp/test/ThriftTest/TestServer.cs
index 2096cf8..0e9fe05 100644
--- a/lib/csharp/test/ThriftTest/TestServer.cs
+++ b/lib/csharp/test/ThriftTest/TestServer.cs
@@ -358,13 +358,14 @@
 
         } // class TestHandler
 
-        public static void Execute(string[] args)
+        public static bool Execute(string[] args)
         {
             try
             {
                 bool useBufferedSockets = false, useFramed = false, useEncryption = false, compact = false, json = false;
                 int port = 9090;
                 string pipe = null;
+                string certPath = "../../../../../keys/server.pem";
                 for (int i = 0; i < args.Length; i++)
                 {
                     if (args[i] == "-pipe")  // -pipe name
@@ -395,6 +396,10 @@
                     {
                         useEncryption = true;
                     }
+                    else if (args[i].StartsWith("--cert="))
+                    {
+                        certPath = args[i].Substring("--cert=".Length);
+                    }
                 }
 
                 // Processor
@@ -411,7 +416,7 @@
                 {
                     if (useEncryption)
                     {
-                        trans = new TTLSServerSocket(port, 0, useBufferedSockets, new X509Certificate2("../../../../../keys/server.pem"));
+                        trans = new TTLSServerSocket(port, 0, useBufferedSockets, new X509Certificate2(certPath));
                     }
                     else
                     {
@@ -461,8 +466,10 @@
             catch (Exception x)
             {
                 Console.Error.Write(x);
+                return false;
             }
             Console.WriteLine("done.");
+            return true;
         }
     }
 }
