THRIFT-309. Make Thrift's C# mapping .NET 2.0 (Mono 1.2.4) compatible


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743963 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/csharp/CSharpServer.cs b/test/csharp/CSharpServer.cs
index 32cc703..5eef03b 100644
--- a/test/csharp/CSharpServer.cs
+++ b/test/csharp/CSharpServer.cs
@@ -1,7 +1,5 @@
 using System;

 using System.Collections.Generic;

-using System.Linq;

-using System.Text;

 using Thrift.Server;

 using Thrift.Transport;

 

diff --git a/test/csharp/ThriftTest/Program.cs b/test/csharp/ThriftTest/Program.cs
index 09bd84f..3860525 100644
--- a/test/csharp/ThriftTest/Program.cs
+++ b/test/csharp/ThriftTest/Program.cs
@@ -4,8 +4,6 @@
 // http://developers.facebook.com/thrift/
 
 using System;
-using System.Collections.Generic;
-using System.Text;
 using Thrift.Transport;
 using Thrift.Protocol;
 using Thrift.Test; //generated code
diff --git a/test/csharp/ThriftTest/TestClient.cs b/test/csharp/ThriftTest/TestClient.cs
index bcdb00e..42b21b8 100644
--- a/test/csharp/ThriftTest/TestClient.cs
+++ b/test/csharp/ThriftTest/TestClient.cs
@@ -1,11 +1,10 @@
 using System;
 using System.Collections.Generic;
-using System.Text;
-
+using System.Threading;
+using Thrift.Collections;
 using Thrift.Protocol;
 using Thrift.Transport;
 using Thrift.Test;
-using System.Threading;
 
 namespace Test
 {
@@ -247,7 +246,7 @@
 			Console.WriteLine("}");
 
 			//set
-			HashSet<int> setout = new HashSet<int>();
+			THashSet<int> setout = new THashSet<int>();
 			for (int j = -2; j < 3; j++)
 			{
 				setout.Add(j);
@@ -268,7 +267,7 @@
 			}
 			Console.Write("})");
 
-			HashSet<int> setin = client.testSet(setout);
+			THashSet<int> setin = client.testSet(setout);
 
 			Console.Write(" = {");
 			first = true;
diff --git a/test/csharp/ThriftTest/TestServer.cs b/test/csharp/ThriftTest/TestServer.cs
index 4efe4b4..18952d4 100644
--- a/test/csharp/ThriftTest/TestServer.cs
+++ b/test/csharp/ThriftTest/TestServer.cs
@@ -4,9 +4,8 @@
 // http://developers.facebook.com/thrift/
 using System;
 using System.Collections.Generic;
-using System.Text;
+using Thrift.Collections;
 using Thrift.Test; //generated code
-
 using Thrift.Transport;
 using Thrift.Protocol;
 using Thrift.Server;
@@ -99,7 +98,7 @@
 				return thing;
 			}
 
-			public HashSet<int> testSet(HashSet<int> thing)
+			public THashSet<int> testSet(THashSet<int> thing)
 			{
 				Console.WriteLine("testSet({");
 				bool first = true;
@@ -305,10 +304,13 @@
 				TServer serverEngine;
 
 				// Simple Server
-				// serverEngine = new TSimpleServer(testProcessor, tServerSocket);
+				serverEngine = new TSimpleServer(testProcessor, tServerSocket);
 
 				// ThreadPool Server
-				serverEngine = new TThreadPoolServer(testProcessor, tServerSocket);
+				// serverEngine = new TThreadPoolServer(testProcessor, tServerSocket);
+
+				// Threaded Server
+				// serverEngine = new TThreadedServer(testProcessor, tServerSocket);
 
 				testHandler.server = serverEngine;
 
diff --git a/test/csharp/ThriftTest/ThriftTest.csproj b/test/csharp/ThriftTest/ThriftTest.csproj
index 8e61173..3f427fd 100644
--- a/test/csharp/ThriftTest/ThriftTest.csproj
+++ b/test/csharp/ThriftTest/ThriftTest.csproj
@@ -51,17 +51,6 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
-    <Reference Include="System.Core">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Xml.Linq">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data.DataSetExtensions">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
     <Reference Include="ThriftImpl, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>.\ThriftImpl.dll</HintPath>
@@ -117,6 +106,6 @@
 
 cd $(ProjectDir)
 
-C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /t:library /out:.\ThriftImpl.dll /recurse:.\gen-csharp\* /reference:$(ProjectDir)..\..\..\lib\csharp\src\bin\Debug\Thrift.dll</PreBuildEvent>
+$(MSBuildToolsPath)\Csc.exe /t:library /out:.\ThriftImpl.dll /recurse:.\gen-csharp\* /reference:$(ProjectDir)..\..\..\lib\csharp\src\bin\Debug\Thrift.dll</PreBuildEvent>
   </PropertyGroup>
 </Project>
diff --git a/test/csharp/ThriftTest/maketest.sh b/test/csharp/ThriftTest/maketest.sh
new file mode 100755
index 0000000..aab34b7
--- /dev/null
+++ b/test/csharp/ThriftTest/maketest.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+../../../compiler/cpp/thrift --gen csharp -o . ../../ThriftTest.thrift
+gmcs /t:library /out:./ThriftImpl.dll /recurse:./gen-csharp/* /reference:../../../lib/csharp/Thrift.dll