THRIFT-525. csharp: ThriftTest project will not generate c# from .thrift file or generate ThriftImpl.dll
C# test project correctly references directories with spaces and deletes only data it generates
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@790732 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/csharp/ThriftTest/ThriftTest.csproj b/test/csharp/ThriftTest/ThriftTest.csproj
index 6775d2e..bb7f176 100644
--- a/test/csharp/ThriftTest/ThriftTest.csproj
+++ b/test/csharp/ThriftTest/ThriftTest.csproj
@@ -95,13 +95,13 @@
</Target>
-->
<PropertyGroup>
- <PreBuildEvent>rmdir /s /q $(ProjectDir)gen-csharp
-del /f /q $(ProjectDir)ThriftImpl.dll
-
-$(ProjectDir)\..\..\..\compiler\cpp\thrift.exe -csharp -o $(ProjectDir) $(ProjectDir)\..\..\ThriftTest.thrift
-
-cd $(ProjectDir)
-
-$(MSBuildToolsPath)\Csc.exe /t:library /out:.\ThriftImpl.dll /recurse:.\gen-csharp\* /reference:$(ProjectDir)..\..\..\lib\csharp\src\bin\Debug\Thrift.dll</PreBuildEvent>
+ <PreBuildEvent>rmdir /s /q "$(ProjectDir)gen-csharp"
+del /f /q "$(ProjectDir)ThriftImpl.dll"
+SET OUTPUT_DIR=$(ProjectDir)
+SET THRIFT_FILE=$(ProjectDir)\..\..\ThriftTest.thrift
+for %25%25I in ("%25OUTPUT_DIR%25") do set SHORT_DIR=%25%25~fsI
+for %25%25I in ("%25THRIFT_FILE%25") do set THRIFT_SHORT=%25%25~fsI
+"$(ProjectDir)\..\..\..\compiler\cpp\thrift.exe" --gen csharp -o %25SHORT_DIR%25 %25THRIFT_SHORT%25
+$(MSBuildToolsPath)\Csc.exe /t:library /out:"$(ProjectDir)ThriftImpl.dll" /recurse:"$(ProjectDir)gen-csharp"\* /reference:"$(ProjectDir)..\..\..\lib\csharp\src\bin\Debug\Thrift.dll"</PreBuildEvent>
</PropertyGroup>
</Project>